Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- app.SetDefaultSignInAsAuthenticationType(CookieAuthenticationDefaults.AuthenticationType);
- app.UseCookieAuthentication(new CookieAuthenticationOptions());
- app.UseOpenIdConnectAuthentication(
- new OpenIdConnectAuthenticationOptions
- {
- ClientId = clientId,
- Authority = authority,
- RedirectUri = redirectUri,
- PostLogoutRedirectUri = redirectUri,
- Scope= OpenIdConnectScope.OpenIdProfile,
- ResponseType = OpenIdConnectResponseType.IdToken,
- Notifications = new OpenIdConnectAuthenticationNotifications
- {
- AuthenticationFailed = context =>
- {
- context.HandleResponse();
- return Task.FromResult(0);
- }
- },
- TokenValidationParameters = new TokenValidationParameters()
- {
- ValidateIssuer = false
- },
- });
- result = await authContext.AcquireTokenAsync(todoListResourceId, clientCredential);
Add Comment
Please, Sign In to add comment