Skip to content

Commit

Permalink
Added new constructor for GraphServiceClient (#2079)
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinM85 committed Aug 18, 2023
1 parent 0ad1f1a commit 18a3655
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/Microsoft.Graph/GraphServiceClient.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// ------------------------------------------------------------------------------
// ------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
// ------------------------------------------------------------------------------

Expand Down Expand Up @@ -52,6 +52,22 @@ public GraphServiceClient(
{
}

/// <summary>
/// Constructs a new <see cref="GraphServiceClient"/>.
/// </summary>
/// <param name="httpClient">The customized <see cref="HttpClient"/> to be used for making requests</param>
/// <param name="tokenCredential">The <see cref="TokenCredential"/> for authenticating request messages.</param>
/// <param name="scopes">List of scopes for the authentication context.</param>
/// <param name="baseUrl">The base service URL. For example, "https://graph.microsoft.com/v1.0"</param>
public GraphServiceClient(
HttpClient httpClient,
TokenCredential tokenCredential,
IEnumerable<string> scopes = null,
string baseUrl = null
):this(httpClient, new Microsoft.Graph.Authentication.AzureIdentityAuthenticationProvider(tokenCredential, null, null, scopes?.ToArray() ?? Array.Empty<string>()), baseUrl)
{
}

/// <summary>
/// Constructs a new <see cref="GraphServiceClient"/>.
/// </summary>
Expand Down

0 comments on commit 18a3655

Please sign in to comment.