Skip to content

Commit f5cf805

Browse files
authored
Merge pull request #3499 from AzureAD/tnorling-patch-1
Remove B2C empty access token workaround
2 parents 6696005 + 3c9f7a6 commit f5cf805

File tree

3 files changed

+7
-41
lines changed

3 files changed

+7
-41
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "none",
3+
"comment": "Documentation Updates #3499",
4+
"packageName": "@azure/msal-browser",
5+
"email": "thomas.norling@microsoft.com",
6+
"dependentChangeType": "none"
7+
}

lib/msal-browser/FAQ.md

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -253,45 +253,6 @@ You can read more about this behavior [here](https://docs.microsoft.com/azure/ac
253253

254254
MSAL.js will only process tokens which it originally requested. If your flow requires that you send a user a link they can use to sign up, you will need to ensure that the link points to your app, not the B2C service directly. An example flow can be seen in the [working with B2C](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/working-with-b2c.md) doc.
255255

256-
## Why is there no access token returned from `acquireTokenSilent`?
257-
258-
Azure AD B2C currently requires refresh tokens to be redeemed with the same scopes that were requested when the refresh token is first obtained. If your application requires different behavior, workarounds include:
259-
260-
#### If your application only needs to support 1 set of scopes:
261-
262-
Please ensure that these scopes are requested as part of the `loginPopup`,`loginRedirect` or `ssoSilent` call made prior to calling `acquireTokenSilent`. This ensures the refresh token is issued for the scopes you need.
263-
264-
#### If your application needs to support more than 1 set of scopes:
265-
266-
Include the first set of scopes in `loginPopup`, `loginRedirect` or `ssoSilent` then make another call to `acquireTokenRedirect`, `acquireTokenPopup` or `ssoSilent` containing your 2nd set of scopes. Until the access tokens expire, `acquireTokenSilent` will return either token from the cache. Once an access token is expired, one of the interactive APIs will need to be called again. This is an example of how you can handle this scenario:
267-
268-
```javascript
269-
// Initial acquisition of scopes 1 and 2
270-
await msal.loginPopup({scopes: ["scope1"]});
271-
const account = msal.getAllAccounts()[0];
272-
await msal.ssoSilent({
273-
scopes: ["scope2"],
274-
loginHint: account.username
275-
});
276-
277-
// Subsequent token acquisition with fallback
278-
msal.acquireTokenSilent({
279-
scopes: ["scope1"],
280-
account: account
281-
}).then((response) => {
282-
if (!response.accessToken) {
283-
return msal.ssoSilent({
284-
scopes: ["scope1"],
285-
loginHint: account.username
286-
});
287-
} else {
288-
return response;
289-
}
290-
});
291-
```
292-
293-
:warning: `ssoSilent` will not work in browsers that disable 3rd party cookies, such as Safari. If you need to support these browsers, call `acquireTokenRedirect` or `acquireTokenPopup`
294-
295256
## What should I do if I believe my issue is with the B2C service itself rather than with the library
296257

297258
In that case, please file a support ticket with the B2C team by following the instructions here: [B2C support options](https://docs.microsoft.com/azure/active-directory-b2c/support-options).

lib/msal-browser/docs/working-with-b2c.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,6 @@ msal.loginRedirect({
111111

112112
Read more [here](https://docs.microsoft.com/en-us/azure/active-directory-b2c/authorization-code-flow#2-get-an-access-token)
113113

114-
Note: Currently there is a known issue where the B2C service responds with the scope "/" which prevents MSAL caching from working properly when requesting clientId as a scope. Currently option 2 is the recommended approach to ensure caching works. Track issue [#2451](#2451) for a resolution to this issue.
115-
116114
2. Expose your own custom scope on your app registration and request this scope:
117115

118116
```javascript

0 commit comments

Comments
 (0)