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
Copy file name to clipboardExpand all lines: articles/active-directory/conditional-access/howto-conditional-access-policy-admin-mfa.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,7 +39,7 @@ Conditional Access policies are powerful tools, we recommend excluding the follo
39
39
40
40
***Emergency access** or **break-glass** accounts to prevent tenant-wide account lockout. In the unlikely scenario all administrators are locked out of your tenant, your emergency-access administrative account can be used to log into the tenant take steps to recover access.
41
41
* More information can be found in the article, [Manage emergency access accounts in Azure AD](../users-groups-roles/directory-emergency-access.md).
42
-
***Service accounts** and **service principles**, such as the Azure AD Connect Sync Account. Service accounts are non-interactive accounts that are not tied to any particular user. They are normally used by back-end services and allow programmatic access to applications. Service accounts should be excluded since MFA can’t be completed programmatically.
42
+
***Service accounts** and **service principals**, such as the Azure AD Connect Sync Account. Service accounts are non-interactive accounts that are not tied to any particular user. They are normally used by back-end services and allow programmatic access to applications. Service accounts should be excluded since MFA can’t be completed programmatically.
43
43
* If your organization has these accounts in use in scripts or code, consider replacing them with [managed identities](../managed-identities-azure-resources/overview.md). As a temporary workaround, you can exclude these specific accounts from the baseline policy.
Copy file name to clipboardExpand all lines: articles/active-directory/develop/scenario-web-api-call-api-acquire-token.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,17 +16,17 @@ ms.workload: identity
16
16
ms.date: 05/07/2019
17
17
ms.author: jmprieur
18
18
ms.custom: aaddev
19
-
#Customer intent: As an application developer, I want to know how to write a web API that calls web APIs using the Microsoft identity platform for developers.
19
+
#Customer intent: As an application developer, I want to know how to write a web API that calls web APIs by using the Microsoft identity platform for developers.
20
20
ms.collection: M365-identity-device-management
21
21
---
22
22
23
-
# Web API that calls web APIs - acquire a token for the app
23
+
# A web API that calls web APIs: Acquire a token for the app
24
24
25
-
Once you've built a client application object, use it to acquire a token that you can use to call a web API.
25
+
After you've built a client application object, use it to acquire a token that you can use to call a web API.
26
26
27
27
## Code in the controller
28
28
29
-
Here's an example of code that will be called in the actions of the API controllers, calling a downstream API (named todolist).
29
+
Here's an example of code that's called in the actions of the API controllers. It calls a downstream API named *todolist*.
`BuildConfidentialClient()` is similar to what you've seen in the article [Web API that calls web APIs - app configuration](scenario-web-api-call-api-app-configuration.md). `BuildConfidentialClient()` instantiates `IConfidentialClientApplication` with a cache that contains only information for one account. The account is provided by the `GetAccountIdentifier` method.
50
+
`BuildConfidentialClient()` is similar to the scenario in [A web API that calls web APIs: App configuration](scenario-web-api-call-api-app-configuration.md). `BuildConfidentialClient()` instantiates `IConfidentialClientApplication` with a cache that contains information for only one account. The account is provided by the `GetAccountIdentifier` method.
51
51
52
-
The `GetAccountIdentifier` method uses the claims associated with the identity of the user for which the web API received the JWT:
52
+
The `GetAccountIdentifier` method uses the claims that are associated with the identity of the user for whom the web API received the JSON Web Token (JWT):
Copy file name to clipboardExpand all lines: articles/active-directory/develop/scenario-web-api-call-api-app-configuration.md
+26-24Lines changed: 26 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,26 +16,26 @@ ms.workload: identity
16
16
ms.date: 07/16/2019
17
17
ms.author: jmprieur
18
18
ms.custom: aaddev
19
-
#Customer intent: As an application developer, I want to know how to write a web API that calls web APIs using the Microsoft identity platform for developers.
19
+
#Customer intent: As an application developer, I want to know how to write a web API that calls web APIs by using the Microsoft identity platform for developers.
20
20
ms.collection: M365-identity-device-management
21
21
---
22
22
23
-
# Web API that calls web APIs - code configuration
23
+
# A web API that calls web APIs: Code configuration
24
24
25
25
After you've registered your web API, you can configure the code for the application.
26
26
27
-
The code to configure your web API so that it calls downstream web APIs builds on top of the code used to protect a web API. For more info, see [Protected web API - app configuration](scenario-protected-web-api-app-configuration.md).
27
+
The code that you use to configure your web API so that it calls downstream web APIs builds on top of the code that's used to protect a web API. For more information, see [Protected web API: App configuration](scenario-protected-web-api-app-configuration.md).
28
28
29
29
## Code subscribed to OnTokenValidated
30
30
31
-
On top of the code configuration for any protected web APIs, you need to subscribe to the validation of the bearer token that's received when your API is called:
31
+
On top of the code configuration for any protected web APIs, you need to subscribe to the validation of the bearer token that you receive when your API is called:
32
32
33
33
```csharp
34
34
/// <summary>
35
-
/// Protects the web API with Microsoft Identity Platform (a.k.k AAD v2.0)
35
+
/// Protects the web API with the Microsoft identity platform, or Azure Active Directory (Azure AD) developer platform
36
36
/// This supposes that the configuration files have a section named "AzureAD"
37
37
/// </summary>
38
-
/// <paramname="services">Service collection to which to add authentication</param>
38
+
/// <paramname="services">The service collection to which to add authentication</param>
// When an access token for our own web API is validated, we add it
49
-
// to MSAL.NET's cache so that it can be used from the controllers.
49
+
// to the MSAL.NET cache so that it can be used from the controllers.
50
50
options.Events=newJwtBearerEvents();
51
51
52
52
options.Events.OnTokenValidated=asynccontext=>
53
53
{
54
54
context.Success();
55
55
56
-
// Adds the token to the cache, and also handles the incremental consent
56
+
// Adds the token to the cache and handles the incremental consent
57
57
// and claim challenges
58
58
AddAccountToCacheFromJwt(context, scopes);
59
59
awaitTask.FromResult(0);
@@ -63,18 +63,18 @@ public static IServiceCollection AddProtectedApiCallsWebApis(this IServiceCollec
63
63
}
64
64
```
65
65
66
-
## On-behalf-of flow
66
+
## On-Behalf-Of flow
67
67
68
68
The AddAccountToCacheFromJwt() method needs to:
69
69
70
-
- Instantiate an MSAL confidential client application.
71
-
- Call `AcquireTokenOnBehalf`to exchange the bearer token that was acquired by the client for the web API, against a bearer token for the same user, but for our API to call a downstream API.
70
+
- Instantiate a Microsoft Authentication Library (MSAL) confidential client application.
71
+
- Call the `AcquireTokenOnBehalf`method. This call exchanges the bearer token that was acquired by the client for the web API against a bearer token for the same user, but it has the API call a downstream API.
72
72
73
73
### Instantiate a confidential client application
74
74
75
-
This flow is only available in the confidential client flow so the protected web API provides client credentials (client secret or certificate) to the [ConfidentialClientApplicationBuilder](https://docs.microsoft.com/dotnet/api/microsoft.identity.client.confidentialclientapplicationbuilder) via the `WithClientSecret` or `WithCertificate`methods, respectively.
75
+
This flow is available only in the confidential client flow, so that the protected web API provides client credentials (client secret or certificate) to the [ConfidentialClientApplicationBuilder class](https://docs.microsoft.com/dotnet/api/microsoft.identity.client.confidentialclientapplicationbuilder) via either the `WithClientSecret` or `WithCertificate`method.

Finally, instead of a client secret or a certificate, confidential client applications can also prove their identity using client assertions.
96
-
This advanced scenario is detailed in [Client assertions](msal-net-client-assertions.md)
95
+
Finally, instead of proving their identity via a client secret or a certificate, confidential client applications can prove their identity by using client assertions.
96
+
For more information about this advanced scenario, see [Confidential client assertions](msal-net-client-assertions.md).
97
97
98
-
### How to call on-behalf-of
98
+
### How to call On-Behalf-Of
99
99
100
-
The on-behalf-of (OBO) call is done by calling the [AcquireTokenOnBehalf](https://docs.microsoft.com/dotnet/api/microsoft.identity.client.acquiretokenonbehalfofparameterbuilder) method on the `IConfidentialClientApplication` interface.
100
+
You make the On-Behalf-Of (OBO) call by calling the [AcquireTokenOnBehalf method](https://docs.microsoft.com/dotnet/api/microsoft.identity.client.acquiretokenonbehalfofparameterbuilder) on the `IConfidentialClientApplication` interface.
101
101
102
-
The `UserAssertion` is built from the bearer token received by the web API from its own clients. There are [two constructors](https://docs.microsoft.com/dotnet/api/microsoft.identity.client.clientcredential.-ctor?view=azure-dotnet), one that takes a JWT bearer token, and one that takes any kind of user assertion (another kind of security token, which type is then specified in an additional parameter named `assertionType`).
102
+
The `UserAssertion` class is built from the bearer token that's received by the web API from its own clients. There are [two constructors](https://docs.microsoft.com/dotnet/api/microsoft.identity.client.clientcredential.-ctor?view=azure-dotnet):
103
+
* One that takes a JSON Web Token (JWT) bearer token
104
+
* One that takes any kind of user assertion, another kind of security token, whose type is then specified in an additional parameter named `assertionType`

105
107
106
-
In practice, the OBO flow is often used to acquire a token for a downstream API and store it in the MSAL.NET user token cache so that other parts of the web API can later call on the [overrides](https://docs.microsoft.com/dotnet/api/microsoft.identity.client.clientapplicationbase.acquiretokensilent?view=azure-dotnet) of ``AcquireTokenOnSilent`` to call the downstream APIs. This call has the effect of refreshing the tokens, if needed.
108
+
In practice, the OBO flow is often used to acquire a token for a downstream API and store it in the MSAL.NET user token cache. You do this so that other parts of the web API can later call on the [overrides](https://docs.microsoft.com/dotnet/api/microsoft.identity.client.clientapplicationbase.acquiretokensilent?view=azure-dotnet) of ``AcquireTokenOnSilent`` to call the downstream APIs. This call has the effect of refreshing the tokens, if needed.
You can also see an example of on behalf of flow implementation in [NodeJS and Azure Functions](https://github.com/Azure-Samples/ms-identity-nodejs-webapi-onbehalfof-azurefunctions/blob/master/MiddleTierAPI/MyHttpTrigger/index.js#L61).
144
+
You can also see an example of OBO flow implementation in [Node.js and Azure Functions](https://github.com/Azure-Samples/ms-identity-nodejs-webapi-onbehalfof-azurefunctions/blob/master/MiddleTierAPI/MyHttpTrigger/index.js#L61).
143
145
144
146
## Protocol
145
147
146
-
For more information about the on-behalf-of protocol, see [Microsoft identity platform and OAuth 2.0 On-Behalf-Of flow](https://docs.microsoft.com/azure/active-directory/develop/v2-oauth2-on-behalf-of-flow).
148
+
For more information about the OBO protocol, see [Microsoft identity platform and OAuth 2.0 On-Behalf-Of flow](https://docs.microsoft.com/azure/active-directory/develop/v2-oauth2-on-behalf-of-flow).
147
149
148
150
## Next steps
149
151
150
152
> [!div class="nextstepaction"]
151
-
> [Acquiring a token for the app](scenario-web-api-call-api-acquire-token.md)
153
+
> [A web API that calls web APIs: Acquire a token for the app](scenario-web-api-call-api-acquire-token.md)
title: Register a web API that calls web APIs - Microsoft identity platform | Azure
3
-
description: Learn how to build a web API that calls downstream web APIs (app registration)
3
+
description: Learn how to build a web API that calls downstream web APIs (app registration).
4
4
services: active-directory
5
5
documentationcenter: dev-center-name
6
6
author: jmprieur
@@ -15,23 +15,23 @@ ms.workload: identity
15
15
ms.date: 05/07/2019
16
16
ms.author: jmprieur
17
17
ms.custom: aaddev
18
-
#Customer intent: As an application developer, I want to know how to write a web API that calls web APIs using the Microsoft identity platform for developers.
18
+
#Customer intent: As an application developer, I want to know how to write a web API that calls web APIs by using the Microsoft identity platform for developers.
19
19
ms.collection: M365-identity-device-management
20
20
---
21
21
22
-
# Web API that calls web APIs - app registration
22
+
# A web API that calls web APIs: App registration
23
23
24
-
A web API that calls downstream web APIs has the same registration as a protected web API. Therefore, you'll need to follow the instructions in [Protected Web API - app registration](scenario-protected-web-api-app-registration.md).
24
+
A web API that calls downstream web APIs has the same registration as a protected web API. Therefore, you need to follow the instructions in [Protected web API: App registration](scenario-protected-web-api-app-registration.md).
25
25
26
-
However, since the web app now calls web APIs, it becomes a confidential client application. That's why there's extra registration info that's required: the app needs to share secrets (client credentials) with the Microsoft identity platform.
26
+
Because the web app now calls web APIs, it becomes a confidential client application. That's why extra registration information is required: the app needs to share secrets (client credentials) with the Microsoft identity platform.
Web applications call APIs on behalf of the user for whom the bearer token was received. They need to request delegated permissions. For details, see [Add permissions to access web APIs](quickstart-configure-app-access-web-apis.md#add-permissions-to-access-web-apis).
32
+
Web apps call APIs on behalf of users for whom the bearer token was received. The web apps need to request delegated permissions. For more information, see [Add permissions to access web APIs](quickstart-configure-app-access-web-apis.md#add-permissions-to-access-web-apis).
Copy file name to clipboardExpand all lines: articles/active-directory/develop/scenario-web-api-call-api-call-api.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,19 +15,19 @@ ms.workload: identity
15
15
ms.date: 05/07/2019
16
16
ms.author: jmprieur
17
17
ms.custom: aaddev
18
-
#Customer intent: As an application developer, I want to know how to write a web API that calls web APIs using the Microsoft identity platform for developers.
18
+
#Customer intent: As an application developer, I want to know how to write a web API that calls web APIs by using the Microsoft identity platform for developers.
19
19
ms.collection: M365-identity-device-management
20
20
---
21
21
22
-
# Web API that calls web APIs - call an API
22
+
# A web API that calls web APIs: Call an API
23
23
24
-
Once you have a token, you can call a protected web API. This is done from the controller of your ASP.NET/ASP.NET Core web API.
24
+
After you have a token, you can call a protected web API. You do this from the controller of your ASP.NET or ASP.NET Core web API.
25
25
26
26
## Controller code
27
27
28
-
Here's the continuation of the example code shown in [Protected web API calls web APIs - acquiring a token](scenario-web-api-call-api-acquire-token.md), called in the actions of the API controllers, calling a downstream API (named todolist).
28
+
The following code continues the example code that's shown in [A web API that calls web APIs: Acquire a token for the app](scenario-web-api-call-api-acquire-token.md). The code is called in the actions of the API controllers. It calls a downstream API named *todolist*.
29
29
30
-
Once you acquired the token, use it as a bearer token to call the downstream API.
30
+
After you've acquired the token, use it as a bearer token to call the downstream API.
//Once the token has been returned by MSAL, add it to the http authorization header, before making the call to access the To Do list service.
49
+
//After the token has been returned by Microsoft Authentication Library (MSAL), add it to the HTTP authorization header before making the call to access the To Do list service.
0 commit comments