Class RemoveAuthorizedClientReactiveOAuth2AuthorizationFailureHandler
- java.lang.Object
-
- org.springframework.security.oauth2.client.RemoveAuthorizedClientReactiveOAuth2AuthorizationFailureHandler
-
- All Implemented Interfaces:
ReactiveOAuth2AuthorizationFailureHandler
public class RemoveAuthorizedClientReactiveOAuth2AuthorizationFailureHandler extends java.lang.Object implements ReactiveOAuth2AuthorizationFailureHandler
AReactiveOAuth2AuthorizationFailureHandlerthat removes anOAuth2AuthorizedClientwhen 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 interfaceRemoveAuthorizedClientReactiveOAuth2AuthorizationFailureHandler.OAuth2AuthorizedClientRemover
-
Field Summary
Fields Modifier and Type Field Description static java.util.Set<java.lang.String>DEFAULT_REMOVE_AUTHORIZED_CLIENT_ERROR_CODESThe default OAuth 2.0 error codes that will trigger removal of the authorized client.
-
Constructor Summary
Constructors Constructor Description RemoveAuthorizedClientReactiveOAuth2AuthorizationFailureHandler(RemoveAuthorizedClientReactiveOAuth2AuthorizationFailureHandler.OAuth2AuthorizedClientRemover authorizedClientRemover)Constructs aRemoveAuthorizedClientReactiveOAuth2AuthorizationFailureHandlerusing the provided parameters.RemoveAuthorizedClientReactiveOAuth2AuthorizationFailureHandler(RemoveAuthorizedClientReactiveOAuth2AuthorizationFailureHandler.OAuth2AuthorizedClientRemover authorizedClientRemover, java.util.Set<java.lang.String> removeAuthorizedClientErrorCodes)Constructs aRemoveAuthorizedClientReactiveOAuth2AuthorizationFailureHandlerusing 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 aRemoveAuthorizedClientReactiveOAuth2AuthorizationFailureHandlerusing the provided parameters.- Parameters:
authorizedClientRemover- theRemoveAuthorizedClientReactiveOAuth2AuthorizationFailureHandler.OAuth2AuthorizedClientRemoverused for removing anOAuth2AuthorizedClientif 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 aRemoveAuthorizedClientReactiveOAuth2AuthorizationFailureHandlerusing the provided parameters.- Parameters:
authorizedClientRemover- theRemoveAuthorizedClientReactiveOAuth2AuthorizationFailureHandler.OAuth2AuthorizedClientRemoverused for removing anOAuth2AuthorizedClientif 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:ReactiveOAuth2AuthorizationFailureHandlerCalled when an OAuth 2.0 Client fails to authorize (or re-authorize) via the authorization server or resource server.- Specified by:
onAuthorizationFailurein interfaceReactiveOAuth2AuthorizationFailureHandler- Parameters:
authorizationException- the exception that contains details about what failedprincipal- thePrincipalthat was attempted to be authorizedattributes- an immutableMapof extra optional attributes present under certain conditions. For example, this might contain aServerWebExchangeif the authorization was performed within the context of aServerWebExchange.- Returns:
- an empty
Monothat completes after this handler has finished handling the event.
-
-