Browse Source
Refactored the access_denied in AddAbpOpenIdConnect.
pull/17045/head
huseyinalan
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
1 additions and
10 deletions
-
framework/src/Volo.Abp.AspNetCore.Authentication.OpenIdConnect/Microsoft/Extensions/DependencyInjection/AbpOpenIdConnectExtensions.cs
|
|
|
@ -37,16 +37,7 @@ public static class AbpOpenIdConnectExtensions |
|
|
|
return authorizationCodeReceived.Invoke(receivedContext); |
|
|
|
}; |
|
|
|
|
|
|
|
options.Events.OnRemoteFailure = remoteFailureContext => |
|
|
|
{ |
|
|
|
if (remoteFailureContext.Failure is OpenIdConnectProtocolException && |
|
|
|
remoteFailureContext.Failure.Message.Contains("access_denied")) |
|
|
|
{ |
|
|
|
remoteFailureContext.HandleResponse(); |
|
|
|
remoteFailureContext.Response.Redirect($"{remoteFailureContext.Request.PathBase}/"); |
|
|
|
} |
|
|
|
return Task.CompletedTask; |
|
|
|
}; |
|
|
|
options.AccessDeniedPath = "/"; |
|
|
|
|
|
|
|
options.Events.OnTokenValidated = async (context) => |
|
|
|
{ |
|
|
|
|