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
Where `scopes` contains scopes being requested to be returned in the access token for the API.
273
275
274
276
For example:
275
277
276
278
* `["user.read"]` for Microsoft Graph
277
279
* `["<Application ID URL>/scope"]` for custom Web APIs (that is, `api://<Application ID>/access_as_user`)
278
280
281
+
#### Get a user token interactively
279
282
280
-
#### Get a user token interactively
281
-
282
-
Sometimes you need the user to interact with the Microsoft identity platform endpoint. For example:
283
+
Sometimes you need the user to interact with the Microsoft identity platform endpoint. For example:
283
284
284
-
* Users might need to reenter their credentials because their password has expired.
285
-
* Your application is requesting access to additional resource scopes that the user needs to consent to.
286
-
* Two-factor authentication is required.
285
+
* Users might need to reenter their credentials because their password has expired.
286
+
* Your application is requesting access to additional resource scopes that the user needs to consent to.
287
+
* Two-factor authentication is required.
287
288
288
-
The recommended pattern for most applications is to call `acquireTokenSilent` first, then catch the exception, and then call `acquireTokenPopup` (or `acquireTokenRedirect`) to start an interactive request.
289
+
The recommended pattern for most applications is to call `acquireTokenSilent` first, then catch the exception, and then call `acquireTokenPopup` (or `acquireTokenRedirect`) to start an interactive request.
289
290
290
-
Calling `acquireTokenPopup` results in a popup sign-in window. Alternatively, `acquireTokenRedirect` redirects users to the Microsoft identity platform endpoint. In that window, users need to confirm their credentials, give consent to the required resource, or complete two-factor authentication.
291
+
Calling `acquireTokenPopup` results in a popup sign-in window. Alternatively, `acquireTokenRedirect` redirects users to the Microsoft identity platform endpoint. In that window, users need to confirm their credentials, give consent to the required resource, or complete two-factor authentication.
291
292
292
-
```javascript
293
+
```javascript
293
294
const requestObj = {
294
295
scopes: ["user.read"]
295
296
};
@@ -300,10 +301,10 @@ For example:
300
301
}).catch(function (error) {
301
302
console.log(error);
302
303
});
303
-
```
304
+
```
304
305
305
-
> [!NOTE]
306
-
> This quickstart uses the `loginRedirect` and `acquireTokenRedirect` methods with Microsoft Internet Explorer because of a [known issue](https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki/Known-issues-on-IE-and-Edge-Browser#issues) related to the handling of popup windows by Internet Explorer.
306
+
> [!NOTE]
307
+
> This quickstart uses the `loginRedirect` and `acquireTokenRedirect` methods with Microsoft Internet Explorer because of a [known issue](https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki/Known-issues-on-IE-and-Edge-Browser#issues) related to the handling of popup windows by Internet Explorer.
0 commit comments