Skip to content

Commit b5772b7

Browse files
committed
Merge branch 'master' of https://github.com/MicrosoftDocs/azure-docs-pr into overview-rewrite
2 parents e456be5 + 31002a8 commit b5772b7

File tree

69 files changed

+1386
-302
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+1386
-302
lines changed

.openpublishing.redirection.json

Lines changed: 545 additions & 0 deletions
Large diffs are not rendered by default.

articles/active-directory/conditional-access/howto-conditional-access-policy-admin-mfa.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Conditional Access policies are powerful tools, we recommend excluding the follo
3939

4040
* **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.
4141
* 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.
4343
* 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.
4444

4545
## Create a Conditional Access policy

articles/active-directory/develop/scenario-web-api-call-api-acquire-token.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@ ms.workload: identity
1616
ms.date: 05/07/2019
1717
ms.author: jmprieur
1818
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.
2020
ms.collection: M365-identity-device-management
2121
---
2222

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
2424

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.
2626

2727
## Code in the controller
2828

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*.
3030

3131
```csharp
3232
private async Task GetTodoList(bool isAppStarting)
@@ -47,9 +47,9 @@ private async Task GetTodoList(bool isAppStarting)
4747
}
4848
```
4949

50-
`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.
5151

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):
5353

5454
```csharp
5555
public static string GetMsalAccountId(this ClaimsPrincipal claimsPrincipal)
@@ -70,4 +70,4 @@ public static string GetMsalAccountId(this ClaimsPrincipal claimsPrincipal)
7070
## Next steps
7171

7272
> [!div class="nextstepaction"]
73-
> [Calling a web API](scenario-web-api-call-api-call-api.md)
73+
> [A web API that calls web APIs: Call an API](scenario-web-api-call-api-call-api.md)

articles/active-directory/develop/scenario-web-api-call-api-app-configuration.md

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,26 @@ ms.workload: identity
1616
ms.date: 07/16/2019
1717
ms.author: jmprieur
1818
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.
2020
ms.collection: M365-identity-device-management
2121
---
2222

23-
# Web API that calls web APIs - code configuration
23+
# A web API that calls web APIs: Code configuration
2424

2525
After you've registered your web API, you can configure the code for the application.
2626

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).
2828

2929
## Code subscribed to OnTokenValidated
3030

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:
3232

3333
```csharp
3434
/// <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
3636
/// This supposes that the configuration files have a section named "AzureAD"
3737
/// </summary>
38-
/// <param name="services">Service collection to which to add authentication</param>
38+
/// <param name="services">The service collection to which to add authentication</param>
3939
/// <param name="configuration">Configuration</param>
4040
/// <returns></returns>
4141
public static IServiceCollection AddProtectedApiCallsWebApis(this IServiceCollection services,
@@ -46,14 +46,14 @@ public static IServiceCollection AddProtectedApiCallsWebApis(this IServiceCollec
4646
services.Configure<JwtBearerOptions>(AzureADDefaults.JwtBearerAuthenticationScheme, options =>
4747
{
4848
// 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.
5050
options.Events = new JwtBearerEvents();
5151

5252
options.Events.OnTokenValidated = async context =>
5353
{
5454
context.Success();
5555

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
5757
// and claim challenges
5858
AddAccountToCacheFromJwt(context, scopes);
5959
await Task.FromResult(0);
@@ -63,18 +63,18 @@ public static IServiceCollection AddProtectedApiCallsWebApis(this IServiceCollec
6363
}
6464
```
6565

66-
## On-behalf-of flow
66+
## On-Behalf-Of flow
6767

6868
The AddAccountToCacheFromJwt() method needs to:
6969

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.
7272

7373
### Instantiate a confidential client application
7474

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.
7676

77-
![image](https://user-images.githubusercontent.com/13203188/55967244-3d8e1d00-5c7a-11e9-8285-a54b05597ec9.png)
77+
![List of IConfidentialClientApplication methods](https://user-images.githubusercontent.com/13203188/55967244-3d8e1d00-5c7a-11e9-8285-a54b05597ec9.png)
7878

7979
```csharp
8080
IConfidentialClientApplication app;
@@ -92,18 +92,20 @@ app = ConfidentialClientApplicationBuilder.Create(config.ClientId)
9292
#endif
9393
```
9494

95-
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).
9797

98-
### How to call on-behalf-of
98+
### How to call On-Behalf-Of
9999

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.
101101

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`
103105

104-
![image](https://user-images.githubusercontent.com/13203188/37082180-afc4b708-21e3-11e8-8af8-a6dcbd2dfba8.png)
106+
![UserAssertion properties and methods](https://user-images.githubusercontent.com/13203188/37082180-afc4b708-21e3-11e8-8af8-a6dcbd2dfba8.png)
105107

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.
107109

108110
```csharp
109111
private void AddAccountToCacheFromJwt(IEnumerable<string> scopes, JwtSecurityToken jwtToken, ClaimsPrincipal principal, HttpContext httpContext)
@@ -125,7 +127,7 @@ private void AddAccountToCacheFromJwt(IEnumerable<string> scopes, JwtSecurityTok
125127
// Create the application
126128
var application = BuildConfidentialClientApplication(httpContext, principal);
127129

128-
// .Result to make sure that the cache is filled-in before the controller tries to get access tokens
130+
// .Result to make sure that the cache is filled in before the controller tries to get access tokens
129131
var result = application.AcquireTokenOnBehalfOf(requestedScopes.Except(scopesRequestedByMsalNet),
130132
userAssertion)
131133
.ExecuteAsync()
@@ -139,13 +141,13 @@ private void AddAccountToCacheFromJwt(IEnumerable<string> scopes, JwtSecurityTok
139141
}
140142
```
141143

142-
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).
143145

144146
## Protocol
145147

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).
147149

148150
## Next steps
149151

150152
> [!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)
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
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).
44
services: active-directory
55
documentationcenter: dev-center-name
66
author: jmprieur
@@ -15,23 +15,23 @@ ms.workload: identity
1515
ms.date: 05/07/2019
1616
ms.author: jmprieur
1717
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.
1919
ms.collection: M365-identity-device-management
2020
---
2121

22-
# Web API that calls web APIs - app registration
22+
# A web API that calls web APIs: App registration
2323

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).
2525

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.
2727

2828
[!INCLUDE [Pre-requisites](../../../includes/active-directory-develop-scenarios-registration-client-secrets.md)]
2929

3030
## API permissions
3131

32-
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).
3333

3434
## Next steps
3535

3636
> [!div class="nextstepaction"]
37-
> [App's code configuration](scenario-web-api-call-api-app-configuration.md)
37+
> [A web API that calls web APIs: Code configuration](scenario-web-api-call-api-app-configuration.md)

articles/active-directory/develop/scenario-web-api-call-api-call-api.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,19 @@ ms.workload: identity
1515
ms.date: 05/07/2019
1616
ms.author: jmprieur
1717
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.
1919
ms.collection: M365-identity-device-management
2020
---
2121

22-
# Web API that calls web APIs - call an API
22+
# A web API that calls web APIs: Call an API
2323

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.
2525

2626
## Controller code
2727

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*.
2929

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.
3131

3232
```csharp
3333
private async Task GetTodoList(bool isAppStarting)
@@ -46,7 +46,7 @@ private async Task GetTodoList(bool isAppStarting)
4646
}
4747
...
4848

49-
// 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.
5050
_httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", result.AccessToken);
5151

5252
// Call the To Do list service.
@@ -58,4 +58,4 @@ HttpResponseMessage response = await _httpClient.GetAsync(TodoListBaseAddress +
5858
## Next steps
5959

6060
> [!div class="nextstepaction"]
61-
> [Move to production](scenario-web-api-call-api-production.md)
61+
> [A web API that calls web APIs: Move to production](scenario-web-api-call-api-production.md)

0 commit comments

Comments
 (0)