Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GraphServiceClient insufficient constructors #2079

Closed
svrooij opened this issue Aug 17, 2023 · 0 comments · Fixed by #2081
Closed

GraphServiceClient insufficient constructors #2079

svrooij opened this issue Aug 17, 2023 · 0 comments · Fixed by #2081

Comments

@svrooij
Copy link
Contributor

svrooij commented Aug 17, 2023

Is your feature request related to a problem? Please describe.
I want to use the GraphServiceClient with a TokenCredential and a HttpClient.

Describe the solution you'd like
An extra constructor that has the following signature

new GraphServiceClient(HttpClient httpClient TokenCredential tokenCredential, string BaseUrl, string[] scopes);
it should function as the current constructor
new GraphServiceClient(HttpClient httpClient, IAuthenticationProvider provider, string BaseUrl);

Describe alternatives you've considered
Creating a wrapper around the TokenCredential and have it implement the IAuthenticationProvider

Additional context

GraphServiceClient graphServiceClient = options.Credential is not null
            ? new GraphServiceClient(options.Credential, RequiredScopes, "https://graph.microsoft.com/beta") //cannot set the HttpClient here.
            : new GraphServiceClient(httpClient, publicClient, "https://graph.microsoft.com/beta");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant