You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/active-directory/develop/scenario-spa-acquire-token.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ ms.service: active-directory
9
9
ms.subservice: develop
10
10
ms.topic: conceptual
11
11
ms.workload: identity
12
-
ms.date: 06/10/2022
12
+
ms.date: 05/18/2023
13
13
ms.author: henrymbugua
14
14
s.reviewer: negoe
15
15
ms.custom: aaddev
@@ -18,7 +18,7 @@ ms.custom: aaddev
18
18
19
19
# Single-page application: Acquire a token to call an API
20
20
21
-
The pattern for acquiring tokens for APIs with [MSAL.js](https://github.com/AzureAD/microsoft-authentication-library-for-js) is to first attempt a silent token request by using the `acquireTokenSilent` method. When this method is called, the library first checks the cache in browser storage to see if a non-expired access token exists and returns it. If no access token is found or the access token found has expired, it attempts to use its refresh token to get a fresh access token. If the refresh token's 24-hour lifetime has also expired, MSAL.js will open a hidden iframe to silently request a new authorization code by leveraging the existing active session with Azure AD (if any), which will then be exchanged for a fresh set of tokens (access _and_ refresh tokens). For more information about single sign-on (SSO) session and token lifetime values in Azure AD, see [Token lifetimes](configurable-token-lifetimes.md). For more information on MSAL.js cache lookup policy, see: [Acquiring an Access Token](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/acquire-token.md#acquiring-an-access-token).
21
+
The pattern for acquiring tokens for APIs with [MSAL.js](https://github.com/AzureAD/microsoft-authentication-library-for-js) is to first attempt a silent token request by using the `acquireTokenSilent` method. When this method is called, the library first checks the cache in browser storage to see if a non-expired access token exists and returns it. If no access token is found or the access token found has expired, it attempts to use its refresh token to get a fresh access token. If the refresh token's 24-hour lifetime has also expired, MSAL.js opens a hidden iframe to silently request a new authorization code by using the existing active session with Azure Active Directory (Azure AD) (if any), which will then be exchanged for a fresh set of tokens (access _and_ refresh tokens). For more information about single sign-on (SSO) session and token lifetime values in Azure AD, see [Token lifetimes](configurable-token-lifetimes.md). For more information on MSAL.js cache lookup policy, see: [Acquiring an Access Token](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/acquire-token.md#acquiring-an-access-token).
22
22
23
23
The silent token requests to Azure AD might fail for reasons like a password change or updated conditional access policies. More often, failures are due to the refresh token's 24-hour lifetime expiring and [the browser blocking third party cookies](reference-third-party-cookies-spas.md), which prevents the use of hidden iframes to continue authenticating the user. In these cases, you should invoke one of the interactive methods (which may prompt the user) to acquire tokens:
24
24
@@ -31,7 +31,7 @@ The choice between a pop-up or redirect experience depends on your application f
31
31
32
32
- If you don't want users to move away from your main application page during authentication, we recommend the pop-up method. Because the authentication redirect happens in a pop-up window, the state of the main application is preserved.
33
33
34
-
- If users have browser constraints or policies where pop-up windows are disabled, you can use the redirect method. Use the redirect method with the Internet Explorer browser, because there are [known issues with pop-up windows on Internet Explorer](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/internet-explorer.md#popups).
34
+
- If users have browser constraints or policies where pop-up windows are disabled, you can use the redirect method. Use the redirect method with the Internet Explorer browser, because there are [known issues with pop-up windows on Internet Explorer](msal-js-known-issues-ie-edge-browsers.md).
35
35
36
36
You can set the API scopes that you want the access token to include when it's building the access token request. All requested scopes might not be granted in the access token. That depends on the user's consent.
37
37
@@ -115,7 +115,7 @@ userAgentApplication
115
115
116
116
The MSAL Angular wrapper provides the HTTP interceptor, which will automatically acquire access tokens silently and attach them to the HTTP requests to APIs.
117
117
118
-
You can specify the scopes for APIs in the `protectedResourceMap` configuration option. `MsalInterceptor`will request the specified scopes when automatically acquiring tokens.
118
+
You can specify the scopes for APIs in the `protectedResourceMap` configuration option. `MsalInterceptor`requests the specified scopes when automatically acquiring tokens.
119
119
120
120
```javascript
121
121
// In app.module.ts
@@ -201,7 +201,7 @@ Alternatively, you can explicitly acquire tokens by using the acquire-token meth
201
201
# [Angular (MSAL.js v1)](#tab/angular1)
202
202
203
203
The MSAL Angular wrapper provides the HTTP interceptor, which will automatically acquire access tokens silently and attach them to the HTTP requests to APIs.
204
-
You can specify the scopes for APIs in the `protectedResourceMap` configuration option. `MsalInterceptor`will request the specified scopes when automatically acquiring tokens.
204
+
You can specify the scopes for APIs in the `protectedResourceMap` configuration option. `MsalInterceptor`requests the specified scopes when automatically acquiring tokens.
205
205
206
206
```javascript
207
207
// app.module.ts
@@ -353,7 +353,7 @@ publicClientApplication
353
353
354
354
# [JavaScript (MSAL.js v2)](#tab/javascript2)
355
355
356
-
The following pattern is as described earlier but shown with a redirect method to acquire tokens interactively. You'll need to call and await `handleRedirectPromise` on page load.
356
+
The following pattern is as described earlier but shown with a redirect method to acquire tokens interactively. You need to call and await `handleRedirectPromise` on page load.
@@ -392,7 +392,7 @@ if (redirectResponse !== null) {
392
392
393
393
# [JavaScript (MSAL.js v1)](#tab/javascript1)
394
394
395
-
The following pattern is as described earlier but shown with a redirect method to acquire tokens interactively. You'll need to register the redirect callback as mentioned earlier.
395
+
The following pattern is as described earlier but shown with a redirect method to acquire tokens interactively. You need to register the redirect callback as mentioned earlier.
396
396
397
397
```javascript
398
398
functionauthCallback(error, response) {
@@ -514,7 +514,7 @@ This code is the same as described earlier.
514
514
515
515
# [React](#tab/react)
516
516
517
-
If `acquireTokenSilent` fails, fallback to `acquireTokenRedirect`. This method will initiate a full-frame redirect and the response will be handled when returning to the application. When this component is rendered after returning from the redirect, `acquireTokenSilent` should now succeed as the tokens will be pulled from the cache.
517
+
If `acquireTokenSilent` fails, fallback to `acquireTokenRedirect`. This method initiates a full-frame redirect and the response will be handled when returning to the application. When this component is rendered after returning from the redirect, `acquireTokenSilent` should now succeed as the tokens will be pulled from the cache.
1. (This step applies to **Organizational settings** only.) Review the consent prompt option:
188
+
1. (This step applies to **Organizational settings** only.) Review the **Automatic redemption** option:
189
189
190
-
-**Suppress consent prompts for users from the other tenant when they access apps and resources in my tenant**: Select this checkbox if you want to automatically redeem invitations so users from the specified tenant don't have to accept the consent prompt when they're added to this tenant using B2B collaboration. This setting will only suppress the consent prompt if the specified tenant checks this setting for outbound access as well.
190
+
-**Automatically redeem invitations with the tenant**<tenant>: Check this setting if you want to automatically redeem invitations. If so, users from the specified tenant won't have to accept the consent prompt the first time they access this tenant using cross-tenant synchronization, B2B collaboration, or B2B direct connect. This setting will only suppress the consent prompt if the specified tenant checks this setting for outbound access as well.
191
191
192
-

192
+

193
193
194
194
1. Select **Save**.
195
195
@@ -285,11 +285,11 @@ With outbound settings, you select which of your users and groups will be able t
285
285
286
286
1. Select the **Trust settings** tab.
287
287
288
-
1. Review the consent prompt option:
288
+
1. Review the **Automatic redemption** option:
289
289
290
-
-**Suppress consent prompts for users from my tenant when they access apps and resources in the other tenant**: Select this checkbox if you want to automatically redeem invitations so users from this tenant don't have to accept the consent prompt when they're added to the specified tenant using B2B collaboration. This setting will only suppress the consent prompt if the specified tenant checks this setting for inbound access as well.
290
+
-**Automatically redeem invitations with the tenant**<tenant>: Check this setting if you want to automatically redeem invitations. If so, users from this tenant don't have to accept the consent prompt the first time they access the specified tenant using cross-tenant synchronization, B2B collaboration, or B2B direct connect. This setting will only suppress the consent prompt if the specified tenant checks this setting for inbound access as well.
291
291
292
-

292
+

1. (This step applies to **Organizational settings** only.) Review the consent prompt option:
182
+
1. (This step applies to **Organizational settings** only.) Review the **Automatic redemption** option:
183
183
184
-
-**Suppress consent prompts for users from the other tenant when they access apps and resources in my tenant**: Select this checkbox if you want to automatically redeem invitations so users from the specified tenant don't have to accept the consent prompt when they access resources in this tenant using B2B direct connect. This setting will only suppress the consent prompt if the specified tenant checks this setting for outbound access as well.
184
+
-**Automatically redeem invitations with the tenant**<tenant>: Check this setting if you want to automatically redeem invitations. If so, users from the specified tenant won't have to accept the consent prompt the first time they access this tenant using cross-tenant synchronization, B2B collaboration, or B2B direct connect. This setting will only suppress the consent prompt if the specified tenant checks this setting for outbound access as well.
185
185
186
-

186
+

187
187
188
188
1. Select **Save**.
189
189
@@ -272,11 +272,11 @@ With outbound settings, you select which of your users and groups will be able t
272
272
273
273
1. Select the **Trust settings** tab.
274
274
275
-
1. Review the consent prompt option:
275
+
1. Review the **Automatic redemption** option:
276
276
277
-
-**Suppress consent prompts for users from my tenant when they access apps and resources in the other tenant**: Select this checkbox if you want to automatically redeem invitations so users from this tenant don't have to accept the consent prompt when they access resources in the specified tenant using B2B direct connect. This setting will only suppress the consent prompt if the specified tenant checks this setting for inbound access as well.
277
+
-**Automatically redeem invitations with the tenant**<tenant>: Check this setting if you want to automatically redeem invitations. If so, users from this tenant don't have to accept the consent prompt the first time they access the specified tenant using cross-tenant synchronization, B2B collaboration, or B2B direct connect. This setting will only suppress the consent prompt if the specified tenant checks this setting for inbound access as well.
278
278
279
-

279
+

Copy file name to clipboardExpand all lines: articles/active-directory/includes/automatic-redemption-include.md
+3-4Lines changed: 3 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,12 +11,11 @@ ms.author: rolyon
11
11
ms.custom: include file
12
12
---
13
13
14
-
The automatic redemption setting is an inbound and outbound organizational trust setting to automatically redeem invitations so users don't have to accept the consent prompt the first time they access the resource/target tenant. This setting is a check box with the following name depending on whether it's inbound or outbound:
14
+
The automatic redemption setting is an inbound and outbound organizational trust setting to automatically redeem invitations so users don't have to accept the consent prompt the first time they access the resource/target tenant. This setting is a check box with the following name:
15
15
16
-
-**Suppress consent prompts for users from the other tenant when they access apps and resources in my tenant**
17
-
-**Suppress consent prompts for users from my tenant when they access apps and resources in the other tenant**
16
+
-**Automatically redeem invitations with the tenant**<tenant>
18
17
19
-
:::image type="content" source="../media/external-identities/inbound-consent-prompt-setting.png" alt-text="Screenshot that shows the inbound suppress consent prompt check box." lightbox="../media/external-identities/inbound-consent-prompt-setting.png":::
18
+
:::image type="content" source="../media/external-identities/inbound-consent-prompt-setting.png" alt-text="Screenshot that shows the inbound Automatic redemption check box." lightbox="../media/external-identities/inbound-consent-prompt-setting.png":::
Copy file name to clipboardExpand all lines: articles/active-directory/manage-apps/app-management-videos.md
+36-5Lines changed: 36 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,11 +33,9 @@ ___
33
33
:::column-end:::
34
34
:::row-end:::
35
35
36
-
37
-
38
36
## Consent and permissions for admins
39
37
40
-
Learn about the options available for managing consent to applications in a tenant. Learn how about delegated permissions and how to revoke previously consented permissions to mitigate risks posed by malicious applications.
38
+
Learn the options available for managing consent to applications in a tenant. Learn about delegated permissions and how to revoke previously consented permissions to mitigate risks posed by malicious applications.
41
39
___
42
40
43
41
:::row:::
@@ -69,8 +67,8 @@ ___
69
67
:::column-end:::
70
68
:::row-end:::
71
69
72
-
73
70
## Assigning owners and users to an enterprise app
71
+
74
72
Learn about who can assign owners to service principals, how to assign these owners, permissions that owners have, and what to do when an owner leaves the organization.
75
73
Learn how to assign users and, groups to an enterprise application and how and why an enterprise app may show up in a tenant.
Learn about the different phases of migrating apps from ADFS to Azure AD and the steps involved in each phase. View a demo on how to migrate a simple app from ADFS to Azure AD and the steps you need to take to ensure a successful migration.
106
+
107
+
___
108
+
109
+
:::row:::
110
+
:::column:::
111
+
1 - [Phase 1 and 2: Discover, scope, and classify apps and plan pilot](https://www.youtube.com/watch?v=PxLIacDpHh4)(4:05)
0 commit comments