Class OAuth2AccessTokenResponseAuthenticationSuccessHandler
java.lang.Object
org.springframework.security.oauth2.server.authorization.web.authentication.OAuth2AccessTokenResponseAuthenticationSuccessHandler
- All Implemented Interfaces:
AuthenticationSuccessHandler
public final class OAuth2AccessTokenResponseAuthenticationSuccessHandler
extends Object
implements AuthenticationSuccessHandler
An implementation of an
AuthenticationSuccessHandler used for handling an
OAuth2AccessTokenAuthenticationToken and returning the
Access Token Response.- Since:
- 7.0
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidonAuthenticationSuccess(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, Authentication authentication) Called when a user has been successfully authenticated.voidsetAccessTokenResponseCustomizer(Consumer<OAuth2AccessTokenAuthenticationContext> accessTokenResponseCustomizer) Sets theConsumerproviding access to theOAuth2AccessTokenAuthenticationContextcontaining anOAuth2AccessTokenResponse.Builderand additional context information.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.security.web.authentication.AuthenticationSuccessHandler
onAuthenticationSuccess
-
Constructor Details
-
OAuth2AccessTokenResponseAuthenticationSuccessHandler
public OAuth2AccessTokenResponseAuthenticationSuccessHandler()
-
-
Method Details
-
onAuthenticationSuccess
public void onAuthenticationSuccess(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, Authentication authentication) throws IOException, jakarta.servlet.ServletException Description copied from interface:AuthenticationSuccessHandlerCalled when a user has been successfully authenticated.- Specified by:
onAuthenticationSuccessin interfaceAuthenticationSuccessHandler- Parameters:
request- the request which caused the successful authenticationresponse- the responseauthentication- the Authentication object which was created during the authentication process.- Throws:
IOExceptionjakarta.servlet.ServletException
-
setAccessTokenResponseCustomizer
public void setAccessTokenResponseCustomizer(Consumer<OAuth2AccessTokenAuthenticationContext> accessTokenResponseCustomizer) Sets theConsumerproviding access to theOAuth2AccessTokenAuthenticationContextcontaining anOAuth2AccessTokenResponse.Builderand additional context information.- Parameters:
accessTokenResponseCustomizer- theConsumerproviding access to theOAuth2AccessTokenAuthenticationContextcontaining anOAuth2AccessTokenResponse.Builder
-