Skip to content

Commit 887b715

Browse files
authored
Merge pull request #209238 from MicrosoftDocs/main
8/25 PM Publishing
2 parents 91c1194 + 65ea022 commit 887b715

File tree

186 files changed

+1492
-2018
lines changed

Some content is hidden

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

186 files changed

+1492
-2018
lines changed

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,11 @@ Microsoft recommends you use the [Microsoft.Identity.Web](https://www.nuget.org/
111111

112112
_Microsoft.Identity.Web_ provides the glue between ASP.NET Core, the authentication middleware, and the [Microsoft Authentication Library (MSAL)](msal-overview.md) for .NET. It allows for a clearer, more robust developer experience and leverages the power of the Microsoft identity platform and Azure AD B2C.
113113

114+
#### ASP.NET for .NET 6.0
114115

115-
**ASP.NET for .NET 6.0** - To create a new web API project that uses Microsoft.Identity.Web, use a project template in the .NET 6.0 CLI or Visual Studio.
116+
To create a new web API project that uses Microsoft.Identity.Web, use a project template in the .NET 6.0 CLI or Visual Studio.
117+
118+
**Dotnet core CLI**
116119

117120
```dotnetcli
118121
# Create new web API that uses Microsoft.Identity.Web
@@ -212,9 +215,7 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
212215
```
213216

214217
> [!NOTE]
215-
> If you use Microsoft.Identity.Web and don't set the `Audience` in *appsettings.json*, the following is used:
216-
> - `$"{ClientId}"` if you have set the [access token accepted version](scenario-protected-web-api-app-registration.md#accepted-token-version) to `2`, or for Azure AD B2C web APIs.
217-
> - `$"api://{ClientId}` in all other cases (for v1.0 [access tokens](access-tokens.md)).
218+
> If you use Microsoft.Identity.Web and don't set the `Audience` in *appsettings.json*, `$"{ClientId}"` is automatically used if you have set the [access token accepted version](scenario-protected-web-api-app-registration.md#accepted-token-version) to `2`, or for Azure AD B2C web APIs.
218219

219220
## Token validation
220221

@@ -283,3 +284,4 @@ You can also validate incoming access tokens in Azure Functions. You can find ex
283284

284285
Move on to the next article in this scenario,
285286
[Verify scopes and app roles in your code](scenario-protected-web-api-verification-scope-app-roles.md).
287+

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

Lines changed: 24 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -81,27 +81,19 @@ Instead of a client secret, you can provide a client certificate. The following
8181

8282
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.
8383

84-
## Startup.cs
84+
## Program.cs
8585

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 *Startup.cs*:
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.
8787

8888
```csharp
8989
using Microsoft.Identity.Web;
9090

91-
public class Startup
92-
{
93-
// ...
94-
public void ConfigureServices(IServiceCollection services)
95-
{
96-
// ...
97-
services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
98-
.AddMicrosoftIdentityWebApi(Configuration, Configuration.GetSection("AzureAd"))
99-
.EnableTokenAcquisitionToCallDownstreamApi()
100-
.AddInMemoryTokenCaches();
101-
// ...
102-
}
103-
// ...
104-
}
91+
// ...
92+
builder.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
93+
.AddMicrosoftIdentityWebApi(Configuration, Configuration.GetSection("AzureAd"))
94+
.EnableTokenAcquisitionToCallDownstreamApi()
95+
.AddInMemoryTokenCaches();
96+
// ...
10597
```
10698

10799
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.
@@ -111,26 +103,18 @@ If you don't want to acquire the token yourself, *Microsoft.Identity.Web* provid
111103
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:
112104

113105
1. Add the [Microsoft.Identity.Web.MicrosoftGraph](https://www.nuget.org/packages/Microsoft.Identity.Web.MicrosoftGraph) NuGet package to your project.
114-
1. Add `.AddMicrosoftGraph()` after `.EnableTokenAcquisitionToCallDownstreamApi()` in the *Startup.cs* file. `.AddMicrosoftGraph()` has several overrides. Using the override that takes a configuration section as a parameter, the code becomes:
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:
115107

116108
```csharp
117109
using Microsoft.Identity.Web;
118110

119-
public class Startup
120-
{
121-
// ...
122-
public void ConfigureServices(IServiceCollection services)
123-
{
124-
// ...
125-
services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
126-
.AddMicrosoftIdentityWebApi(Configuration, Configuration.GetSection("AzureAd"))
127-
.EnableTokenAcquisitionToCallDownstreamApi()
128-
.AddMicrosoftGraph(Configuration.GetSection("GraphBeta"))
129-
.AddInMemoryTokenCaches();
130-
// ...
131-
}
132-
// ...
133-
}
111+
// ...
112+
builder.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
113+
.AddMicrosoftIdentityWebApi(Configuration, Configuration.GetSection("AzureAd"))
114+
.EnableTokenAcquisitionToCallDownstreamApi()
115+
.AddMicrosoftGraph(Configuration.GetSection("GraphBeta"))
116+
.AddInMemoryTokenCaches();
117+
// ...
134118
```
135119

136120
### Option 2: Call a downstream web API other than Microsoft Graph
@@ -140,26 +124,18 @@ To call a downstream API other than Microsoft Graph, *Microsoft.Identity.Web* pr
140124
```csharp
141125
using Microsoft.Identity.Web;
142126

143-
public class Startup
144-
{
145-
// ...
146-
public void ConfigureServices(IServiceCollection services)
147-
{
148-
// ...
149-
services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
150-
.AddMicrosoftIdentityWebApi(Configuration, "AzureAd")
151-
.EnableTokenAcquisitionToCallDownstreamApi()
152-
.AddDownstreamWebApi("MyApi", Configuration.GetSection("GraphBeta"))
153-
.AddInMemoryTokenCaches();
154-
// ...
155-
}
156-
// ...
157-
}
127+
// ...
128+
builder.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
129+
.AddMicrosoftIdentityWebApi(Configuration, "AzureAd")
130+
.EnableTokenAcquisitionToCallDownstreamApi()
131+
.AddDownstreamWebApi("MyApi", Configuration.GetSection("GraphBeta"))
132+
.AddInMemoryTokenCaches();
133+
// ...
158134
```
159135

160136
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.
161137

162-
The following image shows the various possibilities of *Microsoft.Identity.Web* and their impact on the *Startup.cs* file:
138+
The following image shows the various possibilities of *Microsoft.Identity.Web* and their impact on the *Program.cs* file:
163139

164140
:::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":::
165141

articles/active-directory/privileged-identity-management/groups-activate-roles.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,22 @@ description: Learn how to activate your privileged access group roles in Azure A
44
services: active-directory
55
documentationcenter: ''
66
author: amsliu
7-
manager: karenhoran
7+
manager: amycolannino
88
ms.service: active-directory
99
ms.topic: how-to
1010
ms.tgt_pltfrm: na
1111
ms.workload: identity
1212
ms.subservice: pim
13-
ms.date: 02/24/2022
13+
ms.date: 08/24/2022
1414
ms.author: amsliu
15-
ms.reviewer: shaunliu
15+
ms.reviewer: ilyal
1616
ms.custom: pim
1717
ms.collection: M365-identity-device-management
1818
---
1919

2020
# Activate my privileged access group roles in Privileged Identity Management
2121

22-
Use Privileged Identity Management (PIM) in Azure Active Directory (Azure AD), part of Microsoft Entra,to allow eligible role members for privileged access groups to schedule role activation for a specified date and time. They can also select a activation duration up to the maximum duration configured by administrators.
22+
Use Privileged Identity Management (PIM) in Azure Active Directory (Azure AD), part of Microsoft Entra, to allow eligible role members for privileged access groups to schedule role activation for a specified date and time. They can also select an activation duration up to the maximum duration configured by administrators.
2323

2424
This article is for eligible members who want to activate their privileged access group role in Privileged Identity Management.
2525

169 KB
Loading
Loading
Loading
Loading
Loading
Loading

0 commit comments

Comments
 (0)