This repository has been archived by the owner on May 20, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'beta' of https://github.com/stashenergy/react-native-msal…
… into beta
- Loading branch information
Showing
2 changed files
with
80 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# CHANGELOG | ||
|
||
## [3.0.0](https://github.com/stashenergy/react-native-msal/compare/v2.0.3...v3.0.0) | ||
|
||
### Breaking changes | ||
|
||
#### Default export | ||
|
||
Default exported class renamed from `MSALClient` to `PublicClientApplication` and constructor now accepts an `MSALConfiguration` object instead of a `clientId` string. | ||
|
||
```diff | ||
-import MSALClient from 'react-native-msal'; | ||
+import MSALClient, { MSALConfiguration } from 'react-native-msal'; | ||
-const msalClient = new MSALClient(clientId); | ||
+const config: MSALConfiguration = { | ||
+ auth: { | ||
+ clientId, | ||
+ }, | ||
+}; | ||
+const msalClient = new MSALClient(config); | ||
``` | ||
|
||
#### `MSALAccount` and `accountIdentifier` properties | ||
|
||
The `MSALAccount` definition has been modified to include a new `Claims` dictionary. All methods that previously consumed the `identifier` from this type should now provide the entire `MSALAccount` object instead. | ||
|
||
```diff | ||
const result = msalClient.acquireTokenSilent({ | ||
authority, | ||
scopes, | ||
- accountIdentifier: account.identifier, | ||
+ account, | ||
}); | ||
``` | ||
|
||
#### `signOut` method | ||
|
||
The `signout` method has been renamed `signOut` and `authority` removed from the `MSALSignoutParams`. | ||
|
||
```diff | ||
-await msalClient.signout({ | ||
- authority, | ||
+await msalClient.signOut({ | ||
``` | ||
|
||
#### `removeAccount` method | ||
|
||
`MSALRemoveAccountParams` has been removed and so the `removeAccount` method only requires the `account`. | ||
|
||
```diff | ||
-await msalClient.removeAccount({ | ||
+await msalClient.removeAccount( | ||
- authority, | ||
account, | ||
-}) | ||
+) | ||
``` | ||
|
||
#### Webview parameters | ||
|
||
`ios_prefersEphemeralWebBrowserSession` has moved from `acquireToken()` and `signOut()` parameters into the new `webviewParameters` in `MSALInteractiveParams` and `MSALSignoutParams` respectively. | ||
|
||
```diff | ||
-ios_prefersEphemeralWebBrowserSession: true, | ||
+webviewParameters: { | ||
+ ios_prefersEphemeralWebBrowserSession: true, | ||
+}, | ||
``` | ||
|
||
#### `expiresOn` | ||
|
||
`MSALResult.expiresOn` now returns a value in seconds instead of milliseconds. | ||
|
||
#### Azure AD B2C usage | ||
|
||
See [example/src/b2cClient.ts](https://github.com/stashenergy/react-native-msal/blob/beta/example/src/b2cClient.ts), but at the very least, `knownAuthorities` should be added to the initial client constructor. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters