AzureAD / microsoft-identity-web

Helps creating protected web apps and web APIs with Microsoft identity platform and Azure AD B2C

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Feature Request] Add a .WithUser() modifier to the Microsoft Graph queries (like WithAppOnly())

jmprieur opened this issue · comments

Is your feature request related to a problem? Please describe.
In some scenarios not supported by Microsoft.Identity.Web , where user token validation is done by other means than AddMicrosoftIdentityWebApi, when the code processing the request wants to call Microsoft Graph on behalf of the user, it's useful to pass-in the user

Describe the solution you'd like
ClaimsPrincipal user = ...

await _graphServiceClient.Me.GetAsync(r =>
 {
     r.Options.WithUser(user)
 });