Skip to content

Commit 1c5794b

Browse files
committed
Merge branch 'main' into release-asr-edge-zone
2 parents a120ae5 + 7b6e4a0 commit 1c5794b

File tree

239 files changed

+2557
-1558
lines changed

Some content is hidden

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

239 files changed

+2557
-1558
lines changed

.openpublishing.publish.config.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -950,6 +950,7 @@
950950
"articles/iot-accelerators/.openpublishing.redirection.iot-accelerators.json",
951951
"articles/iot-develop/.openpublishing.redirection.iot-develop.json",
952952
"articles/iot-edge/.openpublishing.redirection.iot-edge.json",
953+
"articles/iot-fundamentals/.openpublishing.redirection.iot-fundamentals.json",
953954
"articles/mariadb/.openpublishing.redirection.mariadb.json",
954955
"articles/marketplace/.openpublishing.redirection.marketplace.json",
955956
"articles/mysql/.openpublishing.redirection.mysql.json",

articles/active-directory/develop/delegated-access-primer.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,9 @@ For client app authorization, OneDrive will check whether the client making the
6363

6464
The example given is simplified to illustrate delegated authorization. The production OneDrive service supports many other access scenarios, such as shared files.
6565

66-
## Next steps
66+
## See also
6767

6868
- [Open connect scopes](scopes-oidc.md)
6969
- [RBAC roles](custom-rbac-for-developers.md)
70+
- [Overview of permissions in Microsoft Graph](/graph/permissions-overview)
7071
- [Microsoft Graph permissions reference](/graph/permissions-reference)

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

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,19 @@ description: Learn how to build a web API that calls web APIs (app's code config
44
services: active-directory
55
author: jmprieur
66
manager: CelesteDG
7-
87
ms.service: active-directory
98
ms.subservice: develop
109
ms.topic: conceptual
1110
ms.workload: identity
12-
ms.date: 09/26/2020
11+
ms.date: 08/12/2022
1312
ms.author: jmprieur
1413
ms.custom: aaddev
1514
#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.
1615
---
1716

1817
# A web API that calls web APIs: Code configuration
1918

20-
After you've registered your web API, you can configure the code for the application.
21-
22-
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).
19+
Once registration for a Web API is complete, the application code can be configured. Configuring a web API to call a downstream web API builds on the code that's used in protecting a web API. For more information, see [Protected web API: App configuration](scenario-protected-web-api-app-configuration.md).
2320

2421
# [ASP.NET Core](#tab/aspnetcore)
2522

@@ -29,22 +26,21 @@ Microsoft recommends that you use the [Microsoft.Identity.Web](https://www.nuget
2926

3027
## Client secrets or client certificates
3128

32-
Given that your web API now calls a downstream web API, provide a client secret or client certificate in the *appsettings.json* file. You can also add a section that specifies:
29+
Given that the web API now calls a downstream web API, a client secret or client certificate in *appsettings.json* can be used for authentication. A section can be added to specify:
3330

3431
- The URL of the downstream web API
3532
- The scopes required for calling the API
3633

3734
In the following example, the `GraphBeta` section specifies these settings.
3835

39-
```JSON
36+
```json
4037
{
4138
"AzureAd": {
4239
"Instance": "https://login.microsoftonline.com/",
43-
"ClientId": "[Client_id-of-web-api-eg-2ec40e65-ba09-4853-bcde-bcb60029e596]",
40+
"ClientId": "Enter_the_Application_(client)_ID_here",
4441
"TenantId": "common",
45-
46-
// To call an API
47-
"ClientSecret": "[Copy the client secret added to the app from the Azure portal]",
42+
43+
"ClientSecret": "Enter_the_Application_Client_Secret_Value_here",
4844
"ClientCertificates": []
4945
},
5046
"GraphBeta": {
@@ -54,16 +50,15 @@ In the following example, the `GraphBeta` section specifies these settings.
5450
}
5551
```
5652

57-
Instead of a client secret, you can provide a client certificate. The following code snippet shows using a certificate stored in Azure Key Vault.
53+
Instead of a client secret, a client certificate can be provided. The following code snippet demonstrates a certificate stored in Azure Key Vault.
5854

59-
```JSON
55+
```json
6056
{
6157
"AzureAd": {
6258
"Instance": "https://login.microsoftonline.com/",
63-
"ClientId": "[Client_id-of-web-api-eg-2ec40e65-ba09-4853-bcde-bcb60029e596]",
59+
"ClientId": "Enter_the_Application_(client)_ID_here",
6460
"TenantId": "common",
6561

66-
// To call an API
6762
"ClientCertificates": [
6863
{
6964
"SourceType": "KeyVault",
@@ -79,11 +74,13 @@ Instead of a client secret, you can provide a client certificate. The following
7974
}
8075
```
8176

82-
Microsoft.Identity.Web provides several ways to describe certificates, both by configuration or by code. For details, see [Microsoft.Identity.Web wiki - Using certificates](https://github.com/AzureAD/microsoft-identity-web/wiki/Using-certificates) on GitHub.
77+
*Microsoft.Identity.Web* provides several ways to describe certificates, both by configuration or by code. For details, see [Microsoft.Identity.Web wiki - Using certificates](https://github.com/AzureAD/microsoft-identity-web/wiki/Using-certificates).
8378

8479
## Program.cs
8580

86-
Your web API will need to acquire a token for the downstream API. You specify it by adding the `.EnableTokenAcquisitionToCallDownstreamApi()` line after `.AddMicrosoftIdentityWebApi(Configuration)`. This line exposes the `ITokenAcquisition` service, that you can use in your controller/pages actions. However, as you'll see in the next two bullet points, you can do even simpler. You'll also need to choose a token cache implementation, for example `.AddInMemoryTokenCaches()`, in *Program.cs*. If you use ASP.NET Core 3.1 or 5.0 the code will be similar but in the *Startup.cs* file.
81+
A web API will need to acquire a token for the downstream API. Specify it by adding the `.EnableTokenAcquisitionToCallDownstreamApi()` line after `.AddMicrosoftIdentityWebApi(Configuration)`. This line exposes the `ITokenAcquisition` service that can be used in the controller/pages actions.
82+
83+
However, an alternative method is to implement a token cache. For example, adding `.AddInMemoryTokenCaches()`, to *Program.cs* will allow the token to be cached in memory.
8784

8885
```csharp
8986
using Microsoft.Identity.Web;
@@ -96,14 +93,14 @@ builder.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
9693
// ...
9794
```
9895

99-
If you don't want to acquire the token yourself, *Microsoft.Identity.Web* provides two mechanisms for calling a downstream web API from another API. The option you choose depends on whether you want to call Microsoft Graph or another API.
96+
*Microsoft.Identity.Web* provides two mechanisms for calling a downstream web API from another API. The option you choose depends on whether you want to call Microsoft Graph or another API.
10097

10198
### Option 1: Call Microsoft Graph
10299

103-
If you want to call Microsoft Graph, Microsoft.Identity.Web enables you to directly use the `GraphServiceClient` (exposed by the Microsoft Graph SDK) in your API actions. To expose Microsoft Graph:
100+
To call Microsoft Graph, *Microsoft.Identity.Web* enables you to directly use the `GraphServiceClient` (exposed by the Microsoft Graph SDK) in the API actions. To expose Microsoft Graph:
104101

105-
1. Add the [Microsoft.Identity.Web.MicrosoftGraph](https://www.nuget.org/packages/Microsoft.Identity.Web.MicrosoftGraph) NuGet package to your project.
106-
1. Add `.AddMicrosoftGraph()` after `.EnableTokenAcquisitionToCallDownstreamApi()` in the *Program.cs* file. `.AddMicrosoftGraph()` has several overrides. Using the override that takes a configuration section as a parameter, the code becomes:
102+
1. Add the [Microsoft.Identity.Web.MicrosoftGraph](https://www.nuget.org/packages/Microsoft.Identity.Web.MicrosoftGraph) NuGet package to the project.
103+
1. Add `.AddMicrosoftGraph()` after `.EnableTokenAcquisitionToCallDownstreamApi()` in *Program.cs*. `.AddMicrosoftGraph()` has several overrides. Using the override that takes a configuration section as a parameter, the code becomes:
107104

108105
```csharp
109106
using Microsoft.Identity.Web;
@@ -119,7 +116,7 @@ builder.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
119116

120117
### Option 2: Call a downstream web API other than Microsoft Graph
121118

122-
To call a downstream API other than Microsoft Graph, *Microsoft.Identity.Web* provides `.AddDownstreamWebApi()`, which requests tokens and calls the downstream web API.
119+
To call a downstream API other than Microsoft Graph, *Microsoft.Identity.Web* provides `.AddDownstreamWebApi()`, which requests tokens for the downstream API on behalf of the user.
123120

124121
```csharp
125122
using Microsoft.Identity.Web;
@@ -133,9 +130,9 @@ builder.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
133130
// ...
134131
```
135132

136-
As with web apps, you can choose various token cache implementations. For details, see [Microsoft identity web - Token cache serialization](https://aka.ms/ms-id-web/token-cache-serialization) on GitHub.
137-
138-
The following image shows the various possibilities of *Microsoft.Identity.Web* and their impact on the *Program.cs* file:
133+
Similar to web apps, various token cache implementations can be chosen. For details, see [Microsoft identity web - Token cache serialization](https://aka.ms/ms-id-web/token-cache-serialization) on GitHub.
134+
135+
The following image shows the possibilities of *Microsoft.Identity.Web* and the impact on *Program.cs*:
139136

140137
:::image type="content" source="media/scenarios/microsoft-identity-web-startup-cs.svg" alt-text="Block diagram showing service configuration options in startup dot C S for calling a web API and specifying a token cache implementation":::
141138

@@ -230,4 +227,4 @@ For more information about the OBO protocol, see the [Microsoft identity platfor
230227
## Next steps
231228

232229
Move on to the next article in this scenario,
233-
[Acquire a token for the app](scenario-web-api-call-api-acquire-token.md).
230+
[Acquire a token for the app](scenario-web-api-call-api-acquire-token.md).

articles/active-directory/develop/workload-identity-federation-considerations.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ The creation of federated identity credentials is available on user-assigned man
4545
- Brazil Southeast
4646
- East Asia
4747
- Southeast Asia
48-
- Switzerland West
4948
- South Africa West
5049
- Qatar Central
5150
- Australia Central

articles/active-directory/fundamentals/active-directory-ops-guide-auth.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,7 @@ To avoid this scenario, you should refer to [detect and remediate illicit consen
315315

316316
#### Consent grants recommended reading
317317

318+
- [Overview of Microsoft Graph permissions](/graph/permissions-overview)
318319
- [Microsoft Graph API permissions](/graph/permissions-reference)
319320

320321
### User and group settings

articles/active-directory/fundamentals/service-accounts-governing-azure.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ We recommend the following practices for service account privileges.
6161
* [Use OAuth 2.0 scopes](../develop/v2-permissions-and-consent.md) to limit the functionality a service account can access on a resource.
6262
* Service principals and managed identities can use OAuth 2.0 scopes in either a delegated context that is impersonating a signed-on user, or as service account in the application context. In the application context no is signed-on.
6363

64-
* Check the scopes service accounts request for resources to ensure they're appropriate. For example, if an account is requesting Files.ReadWrite.All, evaluate if it actually needs only File.Read.All. For more information on permissions, see to [Microsoft Graph permission reference](/graph/permissions-reference).
64+
* Check the scopes service accounts request for resources to ensure they're appropriate. For example, if an account is requesting Files.ReadWrite.All, evaluate if it actually needs only File.Read.All. For more information on permissions, see the [Overview of Microsoft Graph permissions](/graph/permissions-overview).
6565

6666
* Ensure you trust the developer of the application or API with the access requested to your resources.
6767

articles/active-directory/governance/entitlement-management-catalog-create.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ To require attributes for access requests:
138138
1. If you chose **Built-in**, select an attribute from the dropdown list. If you chose **Directory schema extension**, enter the attribute name in the text box.
139139

140140
> [!NOTE]
141-
> The User.mobilePhone attribute can be updated only for non-administrator users. Learn more at [this website](/graph/permissions-reference#remarks-5).
141+
> The User.mobilePhone attribute is a sensitive property that can be updated only by some administrators. Learn more at [Who can update sensitive user attributes?](/graph/api/resources/users#who-can-update-sensitive-attributes).
142142
143143
1. Select the answer format you want requestors to use for their answer. Answer formats include **short text**, **multiple choice**, and **long text**.
144144

0 commit comments

Comments
 (0)