Skip to content

Commit fb21235

Browse files
authored
Merge pull request #92102 from TylerMSFT/twhitney-addtable
add table
2 parents e8979c7 + 320b5a1 commit fb21235

File tree

1 file changed

+27
-6
lines changed

1 file changed

+27
-6
lines changed

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

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ ms.devlang: na
1313
ms.topic: conceptual
1414
ms.tgt_pltfrm: na
1515
ms.workload: identity
16-
ms.date: 04/25/2019
16+
ms.date: 10/16/2019
1717
ms.author: twhitney
1818
ms.reviewer: saeeda
1919
ms.custom: aaddev
@@ -34,9 +34,26 @@ This article describes the different authentication flows provided by Microsoft
3434
| [Client credentials](#client-credentials) | Allows you to access web-hosted resources by using the identity of an application. Commonly used for server-to-server interactions that must run in the background, without immediate interaction with a user. | [Daemon apps](scenario-daemon-overview.md) |
3535
| [Device code](#device-code) | Allows users to sign in to input-constrained devices such as a smart TV, IoT device, or printer. | [Desktop/mobile apps](scenario-desktop-acquire-token.md#command-line-tool-without-web-browser) |
3636
| [Integrated Windows Authentication](scenario-desktop-acquire-token.md#integrated-windows-authentication) | Allows applications on domain or Azure Active Directory (Azure AD) joined computers to acquire a token silently (without any UI interaction from the user).| [Desktop/mobile apps](scenario-desktop-acquire-token.md#integrated-windows-authentication) |
37-
| [Username/password](scenario-desktop-acquire-token.md#username--password) | Allows an application to sign in the user by directly handling their password. This flow isn't recommended. | [Desktop/mobile apps](scenario-desktop-acquire-token.md#username--password) |
37+
| [Username/password](scenario-desktop-acquire-token.md#username--password) | Allows an application to sign in the user by directly handling their password. This flow isn't recommended. | [Desktop/mobile apps](scenario-desktop-acquire-token.md#username--password) |
38+
39+
## How each flow emits tokens and codes
40+
41+
Depending on how your client is built, it can use one (or several) of the authentication flows supported by the Microsoft identity platform. These flows can produce a variety of tokens (id_tokens, refresh tokens, access tokens) as well as authorization codes, and require different tokens to make them work. This chart proides an overview:
42+
43+
|Flow | Requires | id_token | access token | refresh token | authorization code |
44+
|-----|----------|----------|--------------|---------------|--------------------|
45+
|[Authorization code flow](v2-oauth2-auth-code-flow.md) | | x | x | x | x|
46+
|[Implicit flow](v2-oauth2-implicit-grant-flow.md) | | x | x | | |
47+
|[Hybrid OIDC flow](v2-protocols-oidc.md#get-access-tokens)| | x | | | x |
48+
|[Refresh token redemption](v2-oauth2-auth-code-flow.md#refresh-the-access-token) | refresh token | x | x | x| |
49+
|[On-behalf-of flow](v2-oauth2-on-behalf-of-flow.md) | access token| x| x| x| |
50+
|[Device code flow](v2-oauth2-device-code.md) | | x| x| x| |
51+
|[Client credentials](v2-oauth2-client-creds-grant-flow.md) | | | x (app-only)| | |
52+
53+
Tokens issued via the implicit mode have a length limitation due to being passed back to the browser via the URL (where `response_mode` is `query` or `fragment`). Some browsers have a limit on the size of the URL that can be put in the browser bar and fail when it is too long. Thus, these tokens do not have `groups` or `wids` claims.
3854

3955
## Interactive
56+
4057
MSAL supports the ability to interactively prompt the user for their credentials to sign in, and obtain a token by using those credentials.
4158

4259
![Diagram of interactive flow](media/msal-authentication-flows/interactive.png)
@@ -59,6 +76,7 @@ Many modern web applications are built as client-side, single page applications,
5976
This authentication flow doesn't include application scenarios that use cross-platform JavaScript frameworks such as Electron and React-Native, because they require further capabilities for interaction with the native platforms.
6077

6178
## Authorization code
79+
6280
MSAL supports the [OAuth 2 authorization code grant](v2-oauth2-auth-code-flow.md). This grant can be used in apps that are installed on a device to gain access to protected resources, such as web APIs. This allows you to add sign-in and API access to your mobile and desktop apps.
6381

6482
When users sign in to web applications (websites), the web application receives an authorization code. The authorization code is redeemed to acquire a token to call web APIs. In ASP.NET and ASP.NET Core web apps, the only goal of `AcquireTokenByAuthorizationCode` is to add a token to the token cache. The token can then be used by the application (usually in the controllers, which just get a token for an API by using `AcquireTokenSilent`).
@@ -71,6 +89,7 @@ In the preceding diagram, the application:
7189
2. Uses the access token to call a web API.
7290

7391
### Considerations
92+
7493
- You can use the authorization code only once to redeem a token. Don't try to acquire a token multiple times with the same authorization code (it's explicitly prohibited by the protocol standard specification). If you redeem the code several times intentionally, or because you are not aware that a framework also does it for you, you'll get the following error: `AADSTS70002: Error validating credentials. AADSTS54005: OAuth2 Authorization code was already redeemed, please retry with a new valid code or use an existing refresh token.`
7594

7695
- If you're writing an ASP.NET or ASP.NET Core application, this might happen if you don't tell the framework that you've already redeemed the authorization code. For this, you need to call the `context.HandleCodeRedemption()` method of the `AuthorizationCodeReceived` event handler.
@@ -101,7 +120,7 @@ The client credentials grant flow permits a web service (a confidential client)
101120
102121
MSAL.NET supports two types of client credentials. These client credentials need to be registered with Azure AD. The credentials are passed in to the constructors of the confidential client application in your code.
103122

104-
### Application secrets
123+
### Application secrets
105124

106125
![Diagram of confidential client with password](media/msal-authentication-flows/confidential-client-password.png)
107126

@@ -110,7 +129,7 @@ In the preceding diagram, the application:
110129
1. Acquires a token by using application secret or password credentials.
111130
2. Uses the token to make requests of the resource.
112131

113-
### Certificates
132+
### Certificates
114133

115134
![Diagram of confidential client with cert](media/msal-authentication-flows/confidential-client-certificate.png)
116135

@@ -123,8 +142,8 @@ These client credentials need to be:
123142
- Registered with Azure AD.
124143
- Passed in at the construction of the confidential client application in your code.
125144

126-
127145
## Device code
146+
128147
MSAL supports the [OAuth 2 device code flow](v2-oauth2-device-code.md), which allows users to sign in to input-constrained devices, such as a smart TV, IoT device, or printer. Interactive authentication with Azure AD requires a web browser. The device code flow lets the user use another device (for example, another computer or a mobile phone) to sign in interactively, where the device or operating system doesn't provide a web browser.
129148

130149
By using the device code flow, the application obtains tokens through a two-step process especially designed for these devices or operating systems. Examples of such applications include those running on IoT devices or command-line tools (CLI).
@@ -146,6 +165,7 @@ In the preceding diagram:
146165
- Microsoft personal accounts aren't yet supported by the Azure AD v2.0 endpoint (you can't use the `/common` or `/consumers` tenants).
147166

148167
## Integrated Windows Authentication
168+
149169
MSAL supports Integrated Windows Authentication (IWA) for desktop or mobile applications that run on a domain joined or Azure AD joined Windows computer. Using IWA, these applications can acquire a token silently (without any UI interaction from the user).
150170

151171
![Diagram of Integrated Windows Authentication](media/msal-authentication-flows/integrated-windows-authentication.png)
@@ -183,7 +203,8 @@ The IWA flow is enabled for .NET desktop, .NET Core, and Windows Universal Platf
183203

184204
For more information on consent, see [v2.0 permissions and consent](v2-permissions-and-consent.md).
185205

186-
## Username/password
206+
## Username/password
207+
187208
MSAL supports the [OAuth 2 resource owner password credentials grant](v2-oauth-ropc.md), which allows an application to sign in the user by directly handling their password. In your desktop application, you can use the username/password flow to acquire a token silently. No UI is required when using the application.
188209

189210
![Diagram of the username/password flow](media/msal-authentication-flows/username-password.png)

0 commit comments

Comments
 (0)