Skip to content

Commit 65ba788

Browse files
committed
updated msal.js methods
1 parent ac65292 commit 65ba788

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed
-5.66 KB
Loading

articles/active-directory/develop/v2-conditional-access-dev-guide.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ manager: CelesteDG
88

99
ms.author: ryanwi
1010
ms.reviewer: jmprieur, saeeda
11-
ms.date: 02/11/2020
11+
ms.date: 02/25/2020
1212
ms.service: active-directory
1313
ms.subservice: develop
1414
ms.custom: aaddev
@@ -152,17 +152,17 @@ If the app is using the MSAL library, a failure to acquire the token is always r
152152

153153
In this scenario, we walk through the case when we have a single-page app (SPA), using MSAL.js to call a Conditional Access protected web API. This is a simple architecture but has some nuances that need to be taken into account when developing around Conditional Access.
154154

155-
In MSAL.js, there are a few functions that obtain tokens: `login()`, `acquireToken(...)`, `acquireTokenPopup(…)`, and `acquireTokenRedirect(…)`.
155+
In MSAL.js, there are a few functions that obtain tokens: `loginPopup()`, `acquireTokenSilent(...)`, `acquireTokenPopup(…)`, and `acquireTokenRedirect(…)`.
156156

157-
* `login()` obtains an ID token through an interactive sign-in request but does not obtain access tokens for any service (including a Conditional Access protected web API).
158-
* `acquireToken(…)` can then be used to silently obtain an access token meaning it does not show UI in any circumstance.
157+
* `loginPopup()` obtains an ID token through an interactive sign-in request but does not obtain access tokens for any service (including a Conditional Access protected web API).
158+
* `acquireTokenSilent(…)` can then be used to silently obtain an access token meaning it does not show UI in any circumstance.
159159
* `acquireTokenPopup(…)` and `acquireTokenRedirect(…)` are both used to interactively request a token for a resource meaning they always show sign-in UI.
160160

161-
When an app needs an access token to call a Web API, it attempts an `acquireToken(…)`. If the token session is expired or we need to comply with a Conditional Access policy, then the *acquireToken* function fails and the app uses `acquireTokenPopup()` or `acquireTokenRedirect()`.
161+
When an app needs an access token to call a Web API, it attempts an `acquireTokenSilent(…)`. If the token session is expired or we need to comply with a Conditional Access policy, then the *acquireToken* function fails and the app uses `acquireTokenPopup()` or `acquireTokenRedirect()`.
162162

163163
![Single-page app using MSAL flow diagram](./media/v2-conditional-access-dev-guide/spa-using-msal-scenario.png)
164164

165-
Let's walk through an example with our Conditional Access scenario. The end user just landed on the site and doesn’t have a session. We perform a `login()` call, get an ID token without multi-factor authentication. Then the user hits a button that requires the app to request data from a web API. The app tries to do an `acquireToken()` call but fails since the user has not performed multi-factor authentication yet and needs to comply with the Conditional Access policy.
165+
Let's walk through an example with our Conditional Access scenario. The end user just landed on the site and doesn’t have a session. We perform a `loginPopup()` call, get an ID token without multi-factor authentication. Then the user hits a button that requires the app to request data from a web API. The app tries to do an `acquireTokenSilent()` call but fails since the user has not performed multi-factor authentication yet and needs to comply with the Conditional Access policy.
166166

167167
Azure AD sends back the following HTTP response:
168168

0 commit comments

Comments
 (0)