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/develop/delegated-access-primer.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -63,8 +63,9 @@ For client app authorization, OneDrive will check whether the client making the
63
63
64
64
The example given is simplified to illustrate delegated authorization. The production OneDrive service supports many other access scenarios, such as shared files.
65
65
66
-
## Next steps
66
+
## See also
67
67
68
68
-[Open connect scopes](scopes-oidc.md)
69
69
-[RBAC roles](custom-rbac-for-developers.md)
70
+
-[Overview of permissions in Microsoft Graph](/graph/permissions-overview)
Copy file name to clipboardExpand all lines: articles/active-directory/develop/scenario-web-api-call-api-app-configuration.md
+23-26Lines changed: 23 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,22 +4,19 @@ description: Learn how to build a web API that calls web APIs (app's code config
4
4
services: active-directory
5
5
author: jmprieur
6
6
manager: CelesteDG
7
-
8
7
ms.service: active-directory
9
8
ms.subservice: develop
10
9
ms.topic: conceptual
11
10
ms.workload: identity
12
-
ms.date: 09/26/2020
11
+
ms.date: 08/12/2022
13
12
ms.author: jmprieur
14
13
ms.custom: aaddev
15
14
#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.
16
15
---
17
16
18
17
# A web API that calls web APIs: Code configuration
19
18
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).
23
20
24
21
# [ASP.NET Core](#tab/aspnetcore)
25
22
@@ -29,22 +26,21 @@ Microsoft recommends that you use the [Microsoft.Identity.Web](https://www.nuget
29
26
30
27
## Client secrets or client certificates
31
28
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:
33
30
34
31
- The URL of the downstream web API
35
32
- The scopes required for calling the API
36
33
37
34
In the following example, the `GraphBeta` section specifies these settings.
@@ -79,11 +74,13 @@ Instead of a client secret, you can provide a client certificate. The following
79
74
}
80
75
```
81
76
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).
83
78
84
79
## Program.cs
85
80
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.
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.
100
97
101
98
### Option 1: Call Microsoft Graph
102
99
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:
104
101
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:
### Option 2: Call a downstream web API other than Microsoft Graph
121
118
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.
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*:
139
136
140
137
:::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":::
141
138
@@ -230,4 +227,4 @@ For more information about the OBO protocol, see the [Microsoft identity platfor
230
227
## Next steps
231
228
232
229
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).
Copy file name to clipboardExpand all lines: articles/active-directory/fundamentals/service-accounts-governing-azure.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
@@ -61,7 +61,7 @@ We recommend the following practices for service account privileges.
61
61
*[Use OAuth 2.0 scopes](../develop/v2-permissions-and-consent.md) to limit the functionality a service account can access on a resource.
62
62
* 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.
63
63
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).
65
65
66
66
* Ensure you trust the developer of the application or API with the access requested to your resources.
Copy file name to clipboardExpand all lines: articles/active-directory/governance/entitlement-management-catalog-create.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
@@ -138,7 +138,7 @@ To require attributes for access requests:
138
138
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.
139
139
140
140
> [!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).
142
142
143
143
1. Select the answer format you want requestors to use for their answer. Answer formats include **short text**, **multiple choice**, and **long text**.
0 commit comments