Last active
February 8, 2023 20:28
-
-
Save maisarissi/3ddc2c8269e6e4a8f13838373fe7751e to your computer and use it in GitHub Desktop.
msgraph-dotnet-v5-rc-custom-auth-flow
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TokenProvider : IAccessTokenProvider | |
{ | |
public Task<string> GetAuthorizationTokenAsync(Uri uri, | |
Dictionary<string, | |
object> additionalAuthenticationContext = default, | |
CancellationToken cancellationToken = default) | |
{ | |
var token = "token"; | |
//get the token and return it in your own way | |
return Task.FromResult(token); | |
} | |
public AllowedHostsValidator AllowedHostsValidator {get;} | |
} | |
var accessTokenProvider = new BaseBearerTokenAuthenticationProvider(new TokenProvider()); | |
var graphServiceClient = new GraphServiceClient(accessTokenProvider); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment