Skip to content

Commit 4ff0b50

Browse files
Learn Build Service GitHub AppLearn Build Service GitHub App
authored andcommitted
Merging changes synced from https://github.com/MicrosoftDocs/azure-docs-pr (branch live)
2 parents 9007340 + 253f939 commit 4ff0b50

File tree

138 files changed

+603
-1424
lines changed

Some content is hidden

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

138 files changed

+603
-1424
lines changed

articles/active-directory/develop/includes/console-app/quickstart-netcore.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -128,14 +128,14 @@ This quickstart application uses a client secret to identify itself as a confide
128128

129129
This section provides an overview of the code required to sign in users. The overview can be useful to understand how the code works, what the main arguments are, and how to add sign-in to an existing .NET Core console application.
130130

131-
### Microsoft.Identity.Web.MicrosoftGraph
131+
### Microsoft.Identity.Web.GraphServiceClient
132132

133-
Microsoft Identity Web (in the [Microsoft.Identity.Web.TokenAcquisition](https://www.nuget.org/packages/Microsoft.Identity.Web.TokenAcquisition) package) is the library that's used to request tokens for accessing an API protected by the Microsoft identity platform. This quickstart requests tokens by using the application's own identity instead of delegated permissions. The authentication flow in this case is known as a [client credentials OAuth flow](../../v2-oauth2-client-creds-grant-flow.md). For more information on how to use MSAL.NET with a client credentials flow, see [this article](https://aka.ms/msal-net-client-credentials). Given the daemon app in this quickstart calls Microsoft Graph, you install the [Microsoft.Identity.Web.MicrosoftGraph](https://www.nuget.org/packages/Microsoft.Identity.Web.MicrosoftGraph) package, which handles automatically authenticated requests to Microsoft Graph (and references itself Microsoft.Identity.Web.TokenAcquisition)
133+
Microsoft Identity Web (in the [Microsoft.Identity.Web.TokenAcquisition](https://www.nuget.org/packages/Microsoft.Identity.Web.TokenAcquisition) package) is the library that's used to request tokens for accessing an API protected by the Microsoft identity platform. This quickstart requests tokens by using the application's own identity instead of delegated permissions. The authentication flow in this case is known as a [client credentials OAuth flow](../../v2-oauth2-client-creds-grant-flow.md). For more information on how to use MSAL.NET with a client credentials flow, see [this article](https://aka.ms/msal-net-client-credentials). Given the daemon app in this quickstart calls Microsoft Graph, you install the [Microsoft.Identity.Web.GraphServiceClient](https://www.nuget.org/packages/Microsoft.Identity.Web.GraphServiceClient) package, which handles automatically authenticated requests to Microsoft Graph (and references itself Microsoft.Identity.Web.TokenAcquisition)
134134

135-
Microsoft.Identity.Web.MicrosoftGraph can be installed by running the following command in the Visual Studio Package Manager Console:
135+
Microsoft.Identity.Web.GraphServiceClient can be installed by running the following command in the Visual Studio Package Manager Console:
136136

137137
```dotnetcli
138-
dotnet add package Microsoft.Identity.Web.MicrosoftGraph
138+
dotnet add package Microsoft.Identity.Web.GraphServiceClient
139139
```
140140

141141
### Application initialization
@@ -203,9 +203,7 @@ To request a token by using the app's identity, use the `AcquireTokenForClient`
203203
```csharp
204204
GraphServiceClient graphServiceClient = serviceProvider.GetRequiredService<GraphServiceClient>();
205205
var users = await graphServiceClient.Users
206-
.Request()
207-
.WithAppOnly()
208-
.GetAsync();
206+
.GetAsync(r => r.Options.WithAppOnly());
209207
```
210208

211209
[!INCLUDE [Help and support](../../../../../includes/active-directory-develop-help-support-include.md)]

articles/active-directory/develop/includes/web-app/quickstart-aspnet-core.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ The controller or its methods can be protected by applying the `[Authorize]` att
162162
[AuthorizeForScopes(ScopeKeySection = "DownstreamApi:Scopes")]
163163
public async Task<IActionResult> Index()
164164
{
165-
var user = await _graphServiceClient.Me.Request().GetAsync();
165+
var user = await _graphServiceClient.Me.GetAsync();
166166
ViewData["ApiResult"] = user.DisplayName;
167167

168168
return View();

articles/active-directory/develop/includes/web-app/quickstart-aspnet.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ You can set up the authentication pipeline with cookie-based authentication by u
101101

102102
```powershell
103103
Install-Package Microsoft.Identity.Web.Owin
104-
Install-Package Microsoft.Identity.Web.MicrosoftGraph
104+
Install-Package Microsoft.Identity.Web.GraphServiceClient
105105
Install-Package Microsoft.Owin.Security.Cookies
106106
```
107107

@@ -167,7 +167,7 @@ You can call Microsoft Graph from the controller by getting the instance of Grap
167167
```csharp
168168
try
169169
{
170-
var me = await this.GetGraphServiceClient().Me.Request().GetAsync();
170+
var me = await this.GetGraphServiceClient().Me.GetAsync();
171171
ViewBag.Username = me.DisplayName;
172172
}
173173
catch (ServiceException graphEx) when (graphEx.InnerException is MicrosoftIdentityWebChallengeUserException)

articles/active-directory/develop/microsoft-identity-web.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ Microsoft Identity Web is available on NuGet as a set of packages that provide m
3636

3737
- [Microsoft.Identity.Web](https://www.nuget.org/packages/Microsoft.Identity.Web) - The main package. Required by all apps that use Microsoft Identity Web.
3838
- [Microsoft.Identity.Web.UI](https://www.nuget.org/packages/Microsoft.Identity.Web.UI) - Optional. Adds UI for user sign-in and sign-out and an associated controller for web apps.
39-
- [Microsoft.Identity.Web.MicrosoftGraph](https://www.nuget.org/packages/Microsoft.Identity.Web.MicrosoftGraph) - Optional. Provides simplified interaction with the Microsoft Graph API.
40-
- [Microsoft.Identity.Web.MicrosoftGraphBeta](https://www.nuget.org/packages/Microsoft.Identity.Web.MicrosoftGraphBeta) - Optional. Provides simplified interaction with the Microsoft Graph API [beta endpoint](/graph/api/overview?view=graph-rest-beta&preserve-view=true).
39+
- [Microsoft.Identity.Web.GraphServiceClient](https://www.nuget.org/packages/Microsoft.Identity.Web.GraphServiceClient) - Optional. Provides simplified interaction with the Microsoft Graph API.
40+
- [Microsoft.Identity.Web.GraphServiceClientBeta](https://www.nuget.org/packages/Microsoft.Identity.Web.GraphServiceClientBeta) - Optional. Provides simplified interaction with the Microsoft Graph API [beta endpoint](/graph/api/overview?view=graph-rest-beta&preserve-view=true).
4141

4242
## Install by using a Visual Studio project template
4343

articles/active-directory/develop/multi-service-web-app-access-microsoft-graph-as-app.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,9 @@ The [ChainedTokenCredential](/dotnet/api/azure.identity.chainedtokencredential),
132132

133133
To see this code as part of a sample application, see the [sample on GitHub](https://github.com/Azure-Samples/ms-identity-easyauth-dotnet-storage-graphapi/tree/main/3-WebApp-graphapi-managed-identity).
134134

135-
### Install the Microsoft.Identity.Web.MicrosoftGraph client library package
135+
### Install the Microsoft.Identity.Web.GraphServiceClient client library package
136136

137-
Install the [Microsoft.Identity.Web.MicrosoftGraph NuGet package](https://www.nuget.org/packages/Microsoft.Identity.Web.MicrosoftGraph) in your project by using the .NET Core command-line interface or the Package Manager Console in Visual Studio.
137+
Install the [Microsoft.Identity.Web.GraphServiceClient NuGet package](https://www.nuget.org/packages/Microsoft.Identity.Web.GraphServiceClient) in your project by using the .NET Core command-line interface or the Package Manager Console in Visual Studio.
138138

139139
#### .NET Core command-line
140140

@@ -143,7 +143,7 @@ Open a command line, and switch to the directory that contains your project file
143143
Run the install commands.
144144

145145
```dotnetcli
146-
dotnet add package Microsoft.Identity.Web.MicrosoftGraph
146+
dotnet add package Microsoft.Identity.Web.GraphServiceClient
147147
dotnet add package Microsoft.Graph
148148
```
149149

@@ -153,7 +153,7 @@ Open the project/solution in Visual Studio, and open the console by using the **
153153

154154
Run the install commands.
155155
```powershell
156-
Install-Package Microsoft.Identity.Web.MicrosoftGraph
156+
Install-Package Microsoft.Identity.Web.GraphServiceClient
157157
Install-Package Microsoft.Graph
158158
```
159159

@@ -189,7 +189,6 @@ public async Task OnGetAsync()
189189
List<MSGraphUser> msGraphUsers = new List<MSGraphUser>();
190190
try
191191
{
192-
//var users = await graphServiceClient.Users.Request().GetAsync();
193192
var users = await graphServiceClient.Users.GetAsync();
194193
foreach (var u in users.Value)
195194
{

articles/active-directory/develop/multi-service-web-app-access-microsoft-graph-as-user.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ To see this code as part of a sample application, see the [sample on GitHub](htt
137137
138138
### Install client library packages
139139

140-
Install the [Microsoft.Identity.Web](https://www.nuget.org/packages/Microsoft.Identity.Web/) and [Microsoft.Identity.Web.MicrosoftGraph](https://www.nuget.org/packages/Microsoft.Identity.Web.MicrosoftGraph) NuGet packages in your project by using the .NET Core command-line interface or the Package Manager Console in Visual Studio.
140+
Install the [Microsoft.Identity.Web](https://www.nuget.org/packages/Microsoft.Identity.Web/) and [Microsoft.Identity.Web.GraphServiceClient](https://www.nuget.org/packages/Microsoft.Identity.Web.GraphServiceClient) NuGet packages in your project by using the .NET Core command-line interface or the Package Manager Console in Visual Studio.
141141

142142
#### .NET Core command line
143143

@@ -146,7 +146,7 @@ Open a command line, and switch to the directory that contains your project file
146146
Run the install commands.
147147

148148
```dotnetcli
149-
dotnet add package Microsoft.Identity.Web.MicrosoftGraph
149+
dotnet add package Microsoft.Identity.Web.GraphServiceClient
150150
151151
dotnet add package Microsoft.Identity.Web
152152
```
@@ -157,7 +157,7 @@ Open the project/solution in Visual Studio, and open the console by using the **
157157

158158
Run the install commands.
159159
```powershell
160-
Install-Package Microsoft.Identity.Web.MicrosoftGraph
160+
Install-Package Microsoft.Identity.Web.GraphServiceClient
161161
162162
Install-Package Microsoft.Identity.Web
163163
```
@@ -256,11 +256,11 @@ public class IndexModel : PageModel
256256
{
257257
try
258258
{
259-
var user = await _graphServiceClient.Me.Request().GetAsync();
259+
var user = await _graphServiceClient.Me.GetAsync();
260260
ViewData["Me"] = user;
261261
ViewData["name"] = user.DisplayName;
262262

263-
using (var photoStream = await _graphServiceClient.Me.Photo.Content.Request().GetAsync())
263+
using (var photoStream = await _graphServiceClient.Me.Photo.Content.GetAsync())
264264
{
265265
byte[] photoByte = ((MemoryStream)photoStream).ToArray();
266266
ViewData["photo"] = Convert.ToBase64String(photoByte);

articles/active-directory/develop/quickstart-v2-aspnet-core-webapp-calls-graph.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@ ms.custom: devx-track-csharp, aaddev, "scenarios:getting-started", "languages:as
139139
> [AuthorizeForScopes(ScopeKeySection = "DownstreamApi:Scopes")]
140140
> public async Task<IActionResult> Index()
141141
> {
142-
> var user = await _graphServiceClient.Me.Request().GetAsync();
143-
> ViewData["ApiResult"] = user.DisplayName;
142+
> var user = await _graphServiceClient.Me.GetAsync();
143+
> ViewData["ApiResult"] = user?.DisplayName;
144144
>
145145
> return View();
146146
> }

articles/active-directory/develop/quickstart-v2-netcore-daemon.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,14 @@ ms.custom: devx-track-csharp, aaddev, identityplatformtop40, "scenarios:getting-
102102
>
103103
> ![Diagram that shows how the sample app generated by this quickstart works.](media/quickstart-v2-netcore-daemon/> netcore-daemon-intro.svg)
104104
>
105-
> ### Microsoft.Identity.Web.MicrosoftGraph
105+
> ### Microsoft.Identity.Web.GraphServiceClient
106106
>
107-
> Microsoft Identity Web (in the [Microsoft.Identity.Web.TokenAcquisition](https://www.nuget.org/packages/Microsoft.Identity.Web.TokenAcquisition) package) is the library that's used to request tokens for accessing an API protected by the Microsoft identity platform. This quickstart requests tokens by using the application's own identity instead of delegated permissions. The authentication flow in this case is known as a [client credentials OAuth flow](v2-oauth2-client-creds-grant-flow.md). For more information on how to use MSAL.NET with a client credentials flow, see [this article](https://aka.ms/msal-net-client-credentials). Given the daemon app in this quickstart calls Microsoft Graph, you install the [Microsoft.Identity.Web.MicrosoftGraph](https://www.nuget.org/packages/Microsoft.Identity.Web.MicrosoftGraph) package, which handles automatically authenticated requests to Microsoft Graph (and references itself Microsoft.Identity.Web.TokenAcquisition)
107+
> Microsoft Identity Web (in the [Microsoft.Identity.Web.TokenAcquisition](https://www.nuget.org/packages/Microsoft.Identity.Web.TokenAcquisition) package) is the library that's used to request tokens for accessing an API protected by the Microsoft identity platform. This quickstart requests tokens by using the application's own identity instead of delegated permissions. The authentication flow in this case is known as a [client credentials OAuth flow](v2-oauth2-client-creds-grant-flow.md). For more information on how to use MSAL.NET with a client credentials flow, see [this article](https://aka.ms/msal-net-client-credentials). Given the daemon app in this quickstart calls Microsoft Graph, you install the [Microsoft.Identity.Web.GraphServiceClient](https://www.nuget.org/packages/Microsoft.Identity.Web.GraphServiceClient) package, which handles automatically authenticated requests to Microsoft Graph (and references itself Microsoft.Identity.Web.TokenAcquisition)
108108
>
109-
> Microsoft.Identity.Web.MicrosoftGraph can be installed by running the following command in the Visual Studio Package Manager Console:
109+
> Microsoft.Identity.Web.GraphServiceClient can be installed by running the following command in the Visual Studio Package Manager Console:
110110
>
111111
> ```dotnetcli
112-
> dotnet add package Microsoft.Identity.Web.MicrosoftGraph
112+
> dotnet add package Microsoft.Identity.Web.GraphServiceClient
113113
> ```
114114
>
115115
> ### Application initialization
@@ -177,9 +177,7 @@ ms.custom: devx-track-csharp, aaddev, identityplatformtop40, "scenarios:getting-
177177
> ```csharp
178178
> GraphServiceClient graphServiceClient = serviceProvider.GetRequiredService<GraphServiceClient>();
179179
> var users = await graphServiceClient.Users
180-
> .Request()
181-
> .WithAppOnly()
182-
> .GetAsync();
180+
> .GetAsync(r => r.Options.WithAppOnly());
183181
> ```
184182
>
185183
> [!INCLUDE [Help and support](../../../includes/active-directory-develop-help-support-include.md)]

articles/active-directory/develop/scenario-daemon-app-configuration.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ Here's an example of defining the configuration in an [*appsettings.json*](https
7070

7171
```
7272

73-
You provide a certificate instead of the client secret, or [workload identity federation](/azure/active-directory/workload-identities/workload-identity-federation.md) credentials.
73+
You provide a certificate instead of the client secret, or [workload identity federation](../workload-identities/workload-identity-federation.md) credentials.
7474

7575
# [Java](#tab/java)
7676

@@ -161,7 +161,7 @@ Reference the MSAL package in your application code.
161161
# [.NET](#tab/idweb)
162162

163163
Add the [Microsoft.Identity.Web.TokenAcquisition](https://www.nuget.org/packages/Microsoft.Identity.Web.TokenAcquisition) NuGet package to your application.
164-
Alternatively, if you want to call Microsoft Graph, add the [Microsoft.Identity.Web.MicrosoftGraph](https://www.nuget.org/packages/Microsoft.Identity.Web.MicrosoftGraph) package.
164+
Alternatively, if you want to call Microsoft Graph, add the [Microsoft.Identity.Web.GraphServiceClient](https://www.nuget.org/packages/Microsoft.Identity.Web.GraphServiceClient) package.
165165
Your project could be as follows. The *appsettings.json* file needs to be copied to the output directory.
166166

167167
```xml
@@ -174,7 +174,7 @@ Your project could be as follows. The *appsettings.json* file needs to be copied
174174
</PropertyGroup>
175175

176176
<ItemGroup>
177-
<PackageReference Include="Microsoft.Identity.Web.MicrosoftGraph" Version="2.6.1" />
177+
<PackageReference Include="Microsoft.Identity.Web.GraphServiceClient" Version="2.12.2" />
178178
</ItemGroup>
179179

180180
<ItemGroup>
@@ -452,7 +452,7 @@ app = ConfidentialClientApplicationBuilder.Create(config.ClientId)
452452
# [.NET](#tab/idweb)
453453

454454
Instead of a client secret or a certificate, the confidential client application can also prove its identity by using client assertions. See
455-
[CredentialDescription](/dotnet/api/microsoft.identity.abstractions.credentialdescription?view=msal-model-dotnet-latest) for details.
455+
[CredentialDescription](/dotnet/api/microsoft.identity.abstractions.credentialdescription?view=msal-model-dotnet-latest&preserve-view=true) for details.
456456

457457
# [Java](#tab/java)
458458

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,7 @@ try
5959
{
6060
GraphServiceClient graphServiceClient = serviceProvider.GetRequiredService<GraphServiceClient>();
6161
var users = await graphServiceClient.Users
62-
.Request()
63-
.WithAppOnly()
64-
.GetAsync();
62+
.GetAsync(r => r.Options.WithAppOnly());
6563
Console.WriteLine($"{users.Count} users");
6664
Console.ReadKey();
6765
}

0 commit comments

Comments
 (0)