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
The OAuth 2.0 On-Behalf-Of (OBO) flow enables an application that invokes a service or web API to pass user authentication to another service or web API. The OBO flow propagates the delegated user identity and permissions through the request chain. For the middle-tier service to make authenticated requests to the downstream service, it must secure an access token from Azure Active Directory (Azure AD) on behalf of the user.
28
28
29
29
> [!IMPORTANT]
30
-
> As of May 2018, an `id_token` can't be used for the On-Behalf-Of flow. Single-page apps (SPAs) must pass an **access** token to a middle-tier confidential client to perform OBO flows. For more detail about the clients that can perform On-Behalf-Of calls, see [limitations](#client-limitations).
30
+
> As of May 2018, an `id_token` can't be used for the On-Behalf-Of flow. Single-page apps (SPAs) must pass an access token to a middle-tier confidential client to perform OBO flows. For more detail about the clients that can perform On-Behalf-Of calls, see [limitations](#client-limitations).
31
31
32
32
## On-Behalf-Of flow diagram
33
33
34
-
The OBO flow starts after the user has been authenticated on an application using the [OAuth 2.0 authorization code grant flow](v1-protocols-oauth-code.md). At that point, the application has an access token (token A) with the user’s claims and consent to access the middle-tier web API (API A). Next, API A needs to make an authenticated request to the downstream web API (API B).
34
+
The OBO flow starts after the user has been authenticated on an application that uses the [OAuth 2.0 authorization code grant flow](v1-protocols-oauth-code.md). At that point, the application has an access token (token A) with the user’s claims and consent to access the middle-tier web API (API A). Next, API A needs to make an authenticated request to the downstream web API (API B).
@@ -52,9 +52,9 @@ Register both the middle-tier service and the client application in Azure AD.
52
52
### Register the middle-tier service
53
53
54
54
1. Sign in to the [Azure portal](https://portal.azure.com).
55
-
1. On the top bar, select your account and look under the **Directory** list to choose an Active Directory tenant for your application.
55
+
1. On the top bar, select your account and look under the **Directory** list to select an Active Directory tenant for your application.
56
56
1. Select **More Services** on the left pane and choose **Azure Active Directory**.
57
-
1. Select **App registrations** and choose**New application registration**.
57
+
1. Select **App registrations** and then**New application registration**.
58
58
1. Enter a friendly name for the application and select the application type.
59
59
1. Depending upon the application type, set either the sign-on URL or the redirect URL to the base URL.
60
60
1. Select **Create** to create the application.
@@ -64,30 +64,30 @@ Register both the middle-tier service and the client application in Azure AD.
64
64
1. When you save this page, the Azure portal displays the key value. Copy and save the key value in a safe location.
65
65
66
66
> [!IMPORTANT]
67
-
> You need the key to configure the application settings in your implementation. This key value is not displayed again nor retrievable by any other means. Record it as soon as it is visible in the Azure Portal.
67
+
> You need the key to configure the application settings in your implementation. This key value is not displayed again, and it isn't retrievable by any other means. Record it as soon as it is visible in the Azure portal.
68
68
69
69
### Register the client application
70
70
71
71
1. Sign in to the [Azure portal](https://portal.azure.com).
72
-
1. On the top bar, select your account and look under the **Directory** list to choose an Active Directory tenant for your application.
72
+
1. On the top bar, select your account and look under the **Directory** list to select an Active Directory tenant for your application.
73
73
1. Select **More Services** on the left pane and choose **Azure Active Directory**.
74
-
1. Select **App registrations** and choose**New application registration**.
74
+
1. Select **App registrations** and then**New application registration**.
75
75
1. Enter a friendly name for the application and select the application type.
76
76
1. Depending upon the application type, set either the sign-on URL or the redirect URL to the base URL.
77
77
1. Select **Create** to create the application.
78
78
1. Configure permissions for your application.
79
79
1. In the Settings menu, choose the **Required permissions** section, and then select **Add** and **Select an API**.
80
-
1. Type the name of the middle-tier service in the textbox.
81
-
1. Choose **Select Permissions** and then select **Access service name**.
80
+
1. Type the name of the middle-tier service in the text field.
81
+
1. Choose **Select Permissions** and then select **Access service name**.
82
82
83
83
### Configure known client applications
84
84
85
-
In this scenario, the middle-tier service needs to obtain the user's consent to access the downstream API without a user interaction. The option to grant access to the downstream API must be presented upfront as part of the consent step during authentication.
85
+
In this scenario, the middle-tier service needs to obtain the user's consent to access the downstream API without a user interaction. The option to grant access to the downstream API must be presented up front as part of the consent step during authentication.
86
86
87
87
Follow the steps below to explicitly bind the client app's registration in Azure AD with the middle-tier service's registration. This operation merges the consent required by both the client and middle-tier into a single dialog.
88
88
89
89
1. Go to the middle-tier service registration and select **Manifest** to open the manifest editor.
90
-
1. Locate the `knownClientApplications` array property and add the Client ID of the client application as an element.
90
+
1. Locate the `knownClientApplications` array property and add the client ID of the client application as an element.
91
91
1. Save the manifest by selecting **Save**.
92
92
93
93
## Service-to-service access token request
@@ -106,11 +106,11 @@ When using a shared secret, a service-to-service access token request contains t
106
106
107
107
| Parameter || Description |
108
108
| --- | --- | --- |
109
-
| grant_type |required | The type of the token request. Since an OBO request uses a JSON Web Token (JWT), the value must be **urn:ietf:params:oauth:grant-type:jwt-bearer**. |
109
+
| grant_type |required | The type of the token request. An OBO request uses a JSON Web Token (JWT) so the value must be **urn:ietf:params:oauth:grant-type:jwt-bearer**. |
110
110
| assertion |required | The value of the access token used in the request. |
111
-
| client_id |required | The App ID assigned to the calling service during registration with Azure AD. To find the App ID in the Azure portal, select **Active Directory**, choose the directory, and then select the application name. |
111
+
| client_id |required | The app ID assigned to the calling service during registration with Azure AD. To find the app ID in the Azure portal, select **Active Directory**, choose the directory, and then select the application name. |
112
112
| client_secret |required | The key registered for the calling service in Azure AD. This value should have been noted at the time of registration. |
113
-
| resource |required | The App ID URI of the receiving service (secured resource). To find the App ID URI in the Azure portal, select **Active Directory** and choose the directory. Select the application name, choose **All settings**, and then select **Properties**. |
113
+
| resource |required | The app ID URI of the receiving service (secured resource). To find the app ID URI in the Azure portal, select **Active Directory** and choose the directory. Select the application name, choose **All settings**, and then select **Properties**. |
114
114
| requested_token_use |required | Specifies how the request should be processed. In the On-Behalf-Of flow, the value must be **on_behalf_of**. |
115
115
| scope |required | A space separated list of scopes for the token request. For OpenID Connect, the scope **openid** must be specified.|
116
116
@@ -140,12 +140,12 @@ A service-to-service access token request with a certificate contains the follow
140
140
141
141
| Parameter || Description |
142
142
| --- | --- | --- |
143
-
| grant_type |required | The type of the token request. Since an OBO request uses a JWT access token, the value must be **urn:ietf:params:oauth:grant-type:jwt-bearer**. |
143
+
| grant_type |required | The type of the token request. An OBO request uses a JWT access token so the value must be **urn:ietf:params:oauth:grant-type:jwt-bearer**. |
144
144
| assertion |required | The value of the token used in the request. |
145
-
| client_id |required | The App ID assigned to the calling service during registration with Azure AD. To find the App ID in the Azure portal, select **Active Directory**, choose the directory, and then select the application name. |
145
+
| client_id |required | The app ID assigned to the calling service during registration with Azure AD. To find the app ID in the Azure portal, select **Active Directory**, choose the directory, and then select the application name. |
146
146
| client_assertion_type |required |The value must be `urn:ietf:params:oauth:client-assertion-type:jwt-bearer`|
147
147
| client_assertion |required | A JSON Web Token that you create and sign with the certificate you registered as credentials for your application. See [certificate credentials](active-directory-certificate-credentials.md) to learn about assertion format and about how to register your certificate.|
148
-
| resource |required | The App ID URI of the receiving service (secured resource). To find the App ID URI in the Azure portal, select **Active Directory** and choose the directory. Select the application name, choose **All settings**, and then select **Properties**. |
148
+
| resource |required | The app ID URI of the receiving service (secured resource). To find the app ID URI in the Azure portal, select **Active Directory** and choose the directory. Select the application name, choose **All settings**, and then select **Properties**. |
149
149
| requested_token_use |required | Specifies how the request should be processed. In the On-Behalf-Of flow, the value must be **on_behalf_of**. |
150
150
| scope |required | A space separated list of scopes for the token request. For OpenID Connect, the scope **openid** must be specified.|
151
151
@@ -182,9 +182,9 @@ A success response is a JSON OAuth 2.0 response with the following parameters:
182
182
| scope |The scope of access granted in the token. |
183
183
| expires_in |The length of time the access token is valid (in seconds). |
184
184
| expires_on |The time when the access token expires. The date is represented as the number of seconds from 1970-01-01T0:0:0Z UTC until the expiration time. This value is used to determine the lifetime of cached tokens. |
185
-
| resource |The App ID URI of the receiving service (secured resource). |
185
+
| resource |The app ID URI of the receiving service (secured resource). |
186
186
| access_token |The requested access token. The calling service can use this token to authenticate to the receiving service. |
187
-
| id_token |The requested id token. The calling service can use this token to verify the user's identity and begin a session with the user. |
187
+
| id_token |The requested ID token. The calling service can use this token to verify the user's identity and begin a session with the user. |
188
188
| refresh_token |The refresh token for the requested access token. The calling service can use this token to request another access token after the current access token expires. |
189
189
190
190
### Success response example
@@ -208,7 +208,7 @@ The following example shows a success response to a request for an access token
208
208
209
209
### Error response example
210
210
211
-
The Azure AD token endpoint returns an error response when it tries to acquire an access token for a downstream API that is set with a conditional access policy (e.g., multi-factor authentication). The middle-tier service should surface this error to the client application so that the client application can provide the user interaction to satisfy the conditional access policy.
211
+
The Azure AD token endpoint returns an error response when it tries to acquire an access token for a downstream API that is set with a conditional access policy (for example, multi-factor authentication). The middle-tier service should surface this error to the client application so that the client application can provide the user interaction to satisfy the conditional access policy.
212
212
213
213
```
214
214
{
@@ -244,24 +244,24 @@ Some OAuth-based web services need to access other web service APIs that accept
244
244
> [!TIP]
245
245
> When you call a SAML-protected web service from a front-end web application, you can simply call the API and initiate a normal interactive authentication flow with the user's existing session. You only need to use an OBO flow when a service-to-service call requires a SAML token to provide user context.
246
246
247
-
### Obtain a SAML token using an OBO request with a shared secret
247
+
### Obtain a SAML token by using an OBO request with a shared secret
248
248
249
249
A service-to-service request for a SAML assertion contains the following parameters:
250
250
251
251
| Parameter || Description |
252
252
| --- | --- | --- |
253
-
| grant_type |required | The type of the token request. For a request using a JWT, the value must be **urn:ietf:params:oauth:grant-type:jwt-bearer**. |
253
+
| grant_type |required | The type of the token request. For a request that uses a JWT, the value must be **urn:ietf:params:oauth:grant-type:jwt-bearer**. |
254
254
| assertion |required | The value of the access token used in the request.|
255
-
| client_id |required | The App ID assigned to the calling service during registration with Azure AD. To find the App ID in the Azure portal, select **Active Directory**, choose the directory, and then select the application name. |
255
+
| client_id |required | The app ID assigned to the calling service during registration with Azure AD. To find the app ID in the Azure portal, select **Active Directory**, choose the directory, and then select the application name. |
256
256
| client_secret |required | The key registered for the calling service in Azure AD. This value should have been noted at the time of registration. |
257
-
| resource |required | The App ID URI of the receiving service (secured resource). This is the resource that will be the Audience of the SAML token. To find the App ID URI in the Azure portal, select **Active Directory** and choose the directory. Select the application name, choose **All settings**, and then select **Properties**. |
257
+
| resource |required | The app ID URI of the receiving service (secured resource). This is the resource that will be the Audience of the SAML token. To find the app ID URI in the Azure portal, select **Active Directory** and choose the directory. Select the application name, choose **All settings**, and then select **Properties**. |
258
258
| requested_token_use |required | Specifies how the request should be processed. In the On-Behalf-Of flow, the value must be **on_behalf_of**. |
259
259
| requested_token_type | required | Specifies the type of token requested. The value can be **urn:ietf:params:oauth:token-type:saml2** or **urn:ietf:params:oauth:token-type:saml1** depending on the requirements of the accessed resource. |
260
260
261
261
The response contains a SAML token encoded in UTF8 and Base64url.
262
262
263
-
-**_SubjectConfirmationData_ for a SAML assertion sourced from an OBO call**: If the target application requires a recipient value in **SubjectConfirmationData**, then the value must be a non-wildcard Reply URL in the resource application configuration.
264
-
-**The _SubjectConfirmationData_ node**: The node can't contain an **InResponseTo** attribute since it's not part of a SAML response. The application receiving the SAML token must be able to accept the SAML assertion without an **InResponseTo** attribute.
263
+
-**SubjectConfirmationData for a SAML assertion sourced from an OBO call**: If the target application requires a recipient value in **SubjectConfirmationData**, then the value must be a non-wildcard Reply URL in the resource application configuration.
264
+
-**The SubjectConfirmationData node**: The node can't contain an **InResponseTo** attribute since it's not part of a SAML response. The application receiving the SAML token must be able to accept the SAML assertion without an **InResponseTo** attribute.
265
265
266
266
-**Consent**: Consent must have been granted to receive a SAML token containing user data on an OAuth flow. For information on permissions and obtaining administrator consent, see [Permissions and consent in the Azure Active Directory v1.0 endpoint](https://docs.microsoft.com/azure/active-directory/develop/v1-permissions-and-consent).
267
267
@@ -273,7 +273,7 @@ The response contains a SAML token encoded in UTF8 and Base64url.
273
273
| scope |The scope of access granted in the token. |
274
274
| expires_in |The length of time the access token is valid (in seconds). |
275
275
| expires_on |The time when the access token expires. The date is represented as the number of seconds from 1970-01-01T0:0:0Z UTC until the expiration time. This value is used to determine the lifetime of cached tokens. |
276
-
| resource |The App ID URI of the receiving service (secured resource). |
276
+
| resource |The app ID URI of the receiving service (secured resource). |
277
277
| access_token |The parameter that returns the SAML assertion. |
278
278
| refresh_token |The refresh token. The calling service can use this token to request another access token after the current SAML assertion expires. |
279
279
@@ -282,17 +282,17 @@ The response contains a SAML token encoded in UTF8 and Base64url.
Public clients with wildcard reply URLs can't use an `id_token` for OBO flows. However, a confidential client can still redeem **access** tokens acquired through the implicit grant flow even if the public client has a wildcard redirect URI registered.
292
292
293
293
## Next steps
294
294
295
-
Learn more about the OAuth 2.0 protocol and another way to perform service-to-service authentication using client credentials:
295
+
Learn more about the OAuth 2.0 protocol and another way to perform service-to-service authentication that uses client credentials:
296
296
297
297
*[Service to service authentication using OAuth 2.0 client credentials grant in Azure AD](v1-oauth2-client-creds-grant-flow.md)
298
298
*[OAuth 2.0 in Azure AD](v1-protocols-oauth-code.md)
0 commit comments