Guest User

Untitled

a guest
Jul 16th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. app.SetDefaultSignInAsAuthenticationType(CookieAuthenticationDefaults.AuthenticationType);
  2.  
  3. app.UseCookieAuthentication(new CookieAuthenticationOptions());
  4.  
  5. app.UseOpenIdConnectAuthentication(
  6. new OpenIdConnectAuthenticationOptions
  7. {
  8. ClientId = clientId,
  9. Authority = authority,
  10. RedirectUri = redirectUri,
  11. PostLogoutRedirectUri = redirectUri,
  12. Scope= OpenIdConnectScope.OpenIdProfile,
  13. ResponseType = OpenIdConnectResponseType.IdToken,
  14. Notifications = new OpenIdConnectAuthenticationNotifications
  15. {
  16. AuthenticationFailed = context =>
  17. {
  18. context.HandleResponse();
  19. return Task.FromResult(0);
  20. }
  21. },
  22.  
  23. TokenValidationParameters = new TokenValidationParameters()
  24. {
  25. ValidateIssuer = false
  26. },
  27. });
  28.  
  29. result = await authContext.AcquireTokenAsync(todoListResourceId, clientCredential);
Add Comment
Please, Sign In to add comment