Class RemoveAuthorizedClientReactiveOAuth2AuthorizationFailureHandler
- java.lang.Object
-
- org.springframework.security.oauth2.client.RemoveAuthorizedClientReactiveOAuth2AuthorizationFailureHandler
-
- All Implemented Interfaces:
ReactiveOAuth2AuthorizationFailureHandler
public class RemoveAuthorizedClientReactiveOAuth2AuthorizationFailureHandler extends java.lang.Object implements ReactiveOAuth2AuthorizationFailureHandler
AReactiveOAuth2AuthorizationFailureHandler
that removes anOAuth2AuthorizedClient
when theOAuth2Error.getErrorCode()
matches one of the configuredOAuth 2.0 error codes
.- Since:
- 5.3
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
RemoveAuthorizedClientReactiveOAuth2AuthorizationFailureHandler.OAuth2AuthorizedClientRemover
-
Field Summary
Fields Modifier and Type Field Description static java.util.Set<java.lang.String>
DEFAULT_REMOVE_AUTHORIZED_CLIENT_ERROR_CODES
The default OAuth 2.0 error codes that will trigger removal of the authorized client.
-
Constructor Summary
Constructors Constructor Description RemoveAuthorizedClientReactiveOAuth2AuthorizationFailureHandler(RemoveAuthorizedClientReactiveOAuth2AuthorizationFailureHandler.OAuth2AuthorizedClientRemover authorizedClientRemover)
Constructs aRemoveAuthorizedClientReactiveOAuth2AuthorizationFailureHandler
using the provided parameters.RemoveAuthorizedClientReactiveOAuth2AuthorizationFailureHandler(RemoveAuthorizedClientReactiveOAuth2AuthorizationFailureHandler.OAuth2AuthorizedClientRemover authorizedClientRemover, java.util.Set<java.lang.String> removeAuthorizedClientErrorCodes)
Constructs aRemoveAuthorizedClientReactiveOAuth2AuthorizationFailureHandler
using the provided parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description reactor.core.publisher.Mono<java.lang.Void>
onAuthorizationFailure(OAuth2AuthorizationException authorizationException, Authentication principal, java.util.Map<java.lang.String,java.lang.Object> attributes)
Called when an OAuth 2.0 Client fails to authorize (or re-authorize) via the authorization server or resource server.
-
-
-
Field Detail
-
DEFAULT_REMOVE_AUTHORIZED_CLIENT_ERROR_CODES
public static final java.util.Set<java.lang.String> DEFAULT_REMOVE_AUTHORIZED_CLIENT_ERROR_CODES
The default OAuth 2.0 error codes that will trigger removal of the authorized client.- See Also:
OAuth2ErrorCodes
-
-
Constructor Detail
-
RemoveAuthorizedClientReactiveOAuth2AuthorizationFailureHandler
public RemoveAuthorizedClientReactiveOAuth2AuthorizationFailureHandler(RemoveAuthorizedClientReactiveOAuth2AuthorizationFailureHandler.OAuth2AuthorizedClientRemover authorizedClientRemover)
Constructs aRemoveAuthorizedClientReactiveOAuth2AuthorizationFailureHandler
using the provided parameters.- Parameters:
authorizedClientRemover
- theRemoveAuthorizedClientReactiveOAuth2AuthorizationFailureHandler.OAuth2AuthorizedClientRemover
used for removing anOAuth2AuthorizedClient
if the error code is one of theDEFAULT_REMOVE_AUTHORIZED_CLIENT_ERROR_CODES
.
-
RemoveAuthorizedClientReactiveOAuth2AuthorizationFailureHandler
public RemoveAuthorizedClientReactiveOAuth2AuthorizationFailureHandler(RemoveAuthorizedClientReactiveOAuth2AuthorizationFailureHandler.OAuth2AuthorizedClientRemover authorizedClientRemover, java.util.Set<java.lang.String> removeAuthorizedClientErrorCodes)
Constructs aRemoveAuthorizedClientReactiveOAuth2AuthorizationFailureHandler
using the provided parameters.- Parameters:
authorizedClientRemover
- theRemoveAuthorizedClientReactiveOAuth2AuthorizationFailureHandler.OAuth2AuthorizedClientRemover
used for removing anOAuth2AuthorizedClient
if the error code is one of theremoveAuthorizedClientErrorCodes
.removeAuthorizedClientErrorCodes
- the OAuth 2.0 error codes which will trigger removal of an authorized client.- See Also:
OAuth2ErrorCodes
-
-
Method Detail
-
onAuthorizationFailure
public reactor.core.publisher.Mono<java.lang.Void> onAuthorizationFailure(OAuth2AuthorizationException authorizationException, Authentication principal, java.util.Map<java.lang.String,java.lang.Object> attributes)
Description copied from interface:ReactiveOAuth2AuthorizationFailureHandler
Called when an OAuth 2.0 Client fails to authorize (or re-authorize) via the authorization server or resource server.- Specified by:
onAuthorizationFailure
in interfaceReactiveOAuth2AuthorizationFailureHandler
- Parameters:
authorizationException
- the exception that contains details about what failedprincipal
- thePrincipal
that was attempted to be authorizedattributes
- an immutableMap
of extra optional attributes present under certain conditions. For example, this might contain aServerWebExchange
if the authorization was performed within the context of aServerWebExchange
.- Returns:
- an empty
Mono
that completes after this handler has finished handling the event.
-
-