Skip to content

Commit 04e8592

Browse files
Merge pull request #233133 from cilwerner/content-health-1
[GTD][freshness] msal-authentication-flows.md is 365+ days stale (ADO-82362)
2 parents 3b90b3c + 945d714 commit 04e8592

File tree

2 files changed

+35
-34
lines changed

2 files changed

+35
-34
lines changed

articles/active-directory/develop/TOC.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
href: security-tokens.md
2626
- name: Microsoft Authentication Library (MSAL)
2727
href: msal-overview.md
28+
- name: Auth flows supported by MSAL
29+
href: msal-authentication-flows.md
2830
- name: Microsoft Graph
2931
href: /graph/overview?toc=/azure/active-directory/develop/toc.json&bc=/azure/active-directory/develop/breadcrumb/toc.json
3032
- name: Glossary of terms
@@ -573,8 +575,6 @@
573575
- name: Microsoft Authentication Library (MSAL) reference
574576
displayName: SDK, library, msal, auth
575577
items:
576-
- name: Auth flows supported by MSAL
577-
href: msal-authentication-flows.md
578578
- name: Request and cache tokens
579579
href: msal-acquire-cache-tokens.md
580580
- name: Public and confidential client apps

articles/active-directory/develop/msal-authentication-flows.md

Lines changed: 33 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ ms.service: active-directory
99
ms.subservice: develop
1010
ms.topic: conceptual
1111
ms.workload: identity
12-
ms.date: 03/22/2022
12+
ms.date: 04/03/2023
1313
ms.author: cwerner
1414
ms.reviewer: saeeda
15+
ms.custom: engagement-fy23
1516
# Customer intent: As an application developer, I want to learn about the authentication flows supported by MSAL.
1617
---
1718

@@ -21,7 +22,7 @@ The Microsoft Authentication Library (MSAL) supports several authorization grant
2122

2223
| Authentication flow | Enables | Supported application types |
2324
|-----------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
24-
| [Authorization code](#authorization-code) | User sign-in and access to web APIs on behalf of the user. | * [Desktop](scenario-desktop-overview.md) <br /> * [Mobile](scenario-mobile-overview.md) <br /> * [Single-page app (SPA)](scenario-spa-overview.md) (requires PKCE) <br /> * [Web](scenario-web-app-call-api-overview.md) |
25+
| [Authorization code](#authorization-code) | User sign-in and access to web APIs on behalf of the user. | [Desktop](scenario-desktop-overview.md) <br /> [Mobile](scenario-mobile-overview.md) <br /> [Single-page app (SPA)](scenario-spa-overview.md) (requires PKCE) <br /> [Web](scenario-web-app-call-api-overview.md) |
2526
| [Client credentials](#client-credentials) | Access to web APIs by using the identity of the application itself. Typically used for server-to-server communication and automated scripts requiring no user interaction. | [Daemon](scenario-daemon-overview.md) |
2627
| [Device code](#device-code) | User sign-in and access to web APIs on behalf of the user on input-constrained devices like smart TVs and IoT devices. Also used by command line interface (CLI) applications. | [Desktop, Mobile](scenario-desktop-acquire-token-device-code-flow.md) |
2728
| [Implicit grant](#implicit-grant) | User sign-in and access to web APIs on behalf of the user. _The implicit grant flow is no longer recommended - use authorization code with PKCE instead._ | * [Single-page app (SPA)](scenario-spa-overview.md) <br /> * [Web](scenario-web-app-call-api-overview.md) |
@@ -57,22 +58,22 @@ Your MSAL-based application should first try to acquire a token silently and fal
5758

5859
The [OAuth 2.0 authorization code grant](v2-oauth2-auth-code-flow.md) can be used by web apps, single-page apps (SPA), and native (mobile and desktop) apps to gain access to protected resources like web APIs.
5960

60-
When users sign in to web applications, the application receives an authorization code that it can redeem for an access token to call web APIs.
61+
When users sign in to web applications, the application receives an authorization code that it can redeem for an access token to call web APIs.
6162

62-
![Diagram of authorization code flow](media/msal-authentication-flows/authorization-code.png)
63+
In the following diagram, the application:
6364

64-
In the preceding diagram, the application:
65-
66-
1. Requests an authorization code which redeemed for an access token.
65+
1. Requests an authorization code which was redeemed for an access token.
6766
2. Uses the access token to call a web API, Microsoft Graph.
6867

68+
![Diagram of authorization code flow.](media/msal-authentication-flows/authorization-code.png)
69+
6970
### Constraints for authorization code
7071

71-
- Single-page applications require Proof Key for Code Exchange (PKCE) when using the authorization code grant flow. PKCE is supported by MSAL.
72+
- Single-page applications require *Proof Key for Code Exchange* (PKCE) when using the authorization code grant flow. PKCE is supported by MSAL.
7273

73-
- The OAuth 2.0 specification requires you use an authorization code to redeem an access token only _once_.
74+
- The OAuth 2.0 specification requires you to use an authorization code to redeem an access token only _once_.
7475

75-
If you attempt to acquire access token multiple times with the same authorization code, an error similar to the following is returned by the Microsoft identity platform. Keep in mind that some libraries and frameworks request the authorization code for you automatically, and requesting a code manually in such cases will also result in this error.
76+
If you attempt to acquire access token multiple times with the same authorization code, an error similar to the following is returned by the Microsoft identity platform. Some libraries and frameworks request the authorization code for you automatically, and requesting a code manually in such cases will also result in this error.
7677

7778
`AADSTS70002: Error validating credentials. AADSTS54005: OAuth2 Authorization code was already redeemed, please retry with a new valid code or use an existing refresh token.`
7879

@@ -84,22 +85,22 @@ The client credentials grant flow permits a web service (a confidential client)
8485

8586
### Application secrets
8687

87-
![Diagram of confidential client with password](media/msal-authentication-flows/confidential-client-password.png)
88-
89-
In the preceding diagram, the application:
88+
In the following diagram, the application:
9089

9190
1. Acquires a token by using application secret or password credentials.
9291
2. Uses the token to make requests of the resource.
9392

94-
### Certificates
93+
![Diagram of confidential client with password.](media/msal-authentication-flows/confidential-client-password.png)
9594

96-
![Diagram of confidential client with cert](media/msal-authentication-flows/confidential-client-certificate.png)
95+
### Certificates
9796

98-
In the preceding diagram, the application:
97+
In the following diagram, the application:
9998

10099
1. Acquires a token by using certificate credentials.
101100
2. Uses the token to make requests of the resource.
102101

102+
![Diagram of confidential client with cert.](media/msal-authentication-flows/confidential-client-certificate.png)
103+
103104
These client credentials need to be:
104105

105106
- Registered with Azure AD.
@@ -115,18 +116,18 @@ The [OAuth 2 device code flow](v2-oauth2-device-code.md) allows users to sign in
115116

116117
By using the device code flow, the application obtains tokens through a two-step process designed for these devices and operating systems. Examples of such applications include those running on IoT devices and command-line interface (CLI) tools.
117118

118-
![Diagram of device code flow](media/msal-authentication-flows/device-code.png)
119-
120-
In the preceding diagram:
119+
In the following diagram:
121120

122121
1. Whenever user authentication is required, the app provides a code and asks the user to use another device like an internet-connected smartphone to visit a URL (for example, `https://microsoft.com/devicelogin`). The user is then prompted to enter the code, and proceeding through a normal authentication experience including consent prompts and [multi-factor authentication](../authentication/concept-mfa-howitworks.md), if necessary.
123122
1. Upon successful authentication, the command-line app receives the required tokens through a back channel, and uses them to perform the web API calls it needs.
124123

124+
![Diagram of device code flow.](media/msal-authentication-flows/device-code.png)
125+
125126
### Constraints for device code
126127

127128
- The device code flow is available only for public client applications.
128129
- When you initialize a public client application in MSAL, use one of these authority formats:
129-
- Tenanted: `https://login.microsoftonline.com/{tenant}/,` where `{tenant}` is either the GUID representing the tenant ID or a domain name associated with the tenant.
130+
- Tenant: `https://login.microsoftonline.com/{tenant}/,` where `{tenant}` is either the GUID representing the tenant ID or a domain name associated with the tenant.
130131
- Work and school accounts: `https://login.microsoftonline.com/organizations/`.
131132

132133
## Implicit grant
@@ -149,15 +150,15 @@ Tokens issued via the implicit flow mode have a **length limitation** because th
149150

150151
The [OAuth 2 on-behalf-of authentication flow](v2-oauth2-on-behalf-of-flow.md) flow is used when an application invokes a service or web API that in turn needs to call another service or web API. The idea is to propagate the delegated user identity and permissions through the request chain. For the middle-tier service to make authenticated requests to the downstream service, it needs to secure an access token from the Microsoft identity platform *on behalf of* the user.
151152

152-
![Diagram of on-behalf-of flow](media/msal-authentication-flows/on-behalf-of.png)
153-
154-
In the preceding diagram:
153+
In the following diagram:
155154

156155
1. The application acquires an access token for the web API.
157156
2. A client (web, desktop, mobile, or single-page application) calls a protected web API, adding the access token as a bearer token in the authentication header of the HTTP request. The web API authenticates the user.
158157
3. When the client calls the web API, the web API requests another token on-behalf-of the user.
159158
4. The protected web API uses this token to call a downstream web API on-behalf-of the user. The web API can also later request tokens for other downstream APIs (but still on behalf of the same user).
160159

160+
![Diagram of on-behalf-of flow.](media/msal-authentication-flows/on-behalf-of.png)
161+
161162
## Username/password (ROPC)
162163

163164
> [!WARNING]
@@ -167,13 +168,13 @@ The [OAuth 2 resource owner password credentials](v2-oauth-ropc.md) (ROPC) grant
167168

168169
Some application scenarios like DevOps might find ROPC useful, but you should avoid it in any application in which you provide an interactive UI for user sign-in.
169170

170-
![Diagram of the username/password flow](media/msal-authentication-flows/username-password.png)
171-
172-
In the preceding diagram, the application:
171+
In the following diagram, the application:
173172

174173
1. Acquires a token by sending the username and password to the identity provider.
175174
2. Calls a web API by using the token.
176175

176+
![Diagram of the username/password flow.](media/msal-authentication-flows/username-password.png)
177+
177178
To acquire a token silently on Windows domain-joined machines, we recommend [integrated Windows authentication (IWA)](#integrated-windows-authentication-iwa) instead of ROPC. For other scenarios, use the [device code flow](#device-code).
178179

179180
### Constraints for ROPC
@@ -195,13 +196,13 @@ The following constraints apply to the applications using the ROPC flow:
195196

196197
MSAL supports integrated Windows authentication (IWA) for desktop and mobile applications that run on domain-joined or Azure AD-joined Windows computers. By using IWA, these applications acquire a token silently without requiring UI interaction by user.
197198

198-
![Diagram of integrated Windows authentication](media/msal-authentication-flows/integrated-windows-authentication.png)
199-
200-
In the preceding diagram, the application:
199+
In the following diagram, the application:
201200

202201
1. Acquires a token by using integrated Windows authentication.
203202
2. Uses the token to make requests of the resource.
204203

204+
![Diagram of integrated Windows authentication.](media/msal-authentication-flows/integrated-windows-authentication.png)
205+
205206
### Constraints for IWA
206207

207208
**Compatibility**
@@ -239,10 +240,10 @@ To satisfy either requirement, one of these operations must have been completed:
239240

240241
- You as the application developer have selected **Grant** in the Azure portal for yourself.
241242
- A tenant admin has selected **Grant/revoke admin consent for {tenant domain}** in the **API permissions** tab of the app registration in the Azure portal; see [Add permissions to access your web API](quickstart-configure-app-access-web-apis.md#add-permissions-to-access-your-web-api).
242-
- You've provided a way for users to consent to the application; see [Requesting individual user consent](v2-permissions-and-consent.md#requesting-individual-user-consent).
243-
- You've provided a way for the tenant admin to consent for the application; see [admin consent](v2-permissions-and-consent.md#requesting-consent-for-an-entire-tenant).
243+
- You've provided a way for users to consent to the application; see [User consent](../manage-apps/user-admin-consent-overview.md#user-consent).
244+
- You've provided a way for the tenant admin to consent for the application; see [Administrator consent]../manage-apps/user-admin-consent-overview.md#administrator-consent).
244245

245-
For more information on consent, see [Permissions and consent](v2-permissions-and-consent.md).
246+
For more information on consent, see [Permissions and consent](v2-permissions-and-consent.md#consent).
246247

247248
## Next steps
248249

0 commit comments

Comments
 (0)