Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private static IAuthenticationProvider CreateAuthorizationProvider(IConfigurationRoot config, string userName, SecureString userPassword)
- {
- var clientId = config["applicationId"];
- var authority = $"https://login.microsoftonline.com/{config["tenantId"]}/v2.0";
- List<string> scopes = new List<string>();
- scopes.Add("User.Read");
- scopes.Add("User.Read.All");
- var cca = PublicClientApplicationBuilder.Create(clientId)
- .WithAuthority(authority)
- .Build();
- return MsalAuthenticationProvider.GetInstance(cca, scopes.ToArray(), userName, userPassword);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement