Class OAuth2AccessTokenResponseAuthenticationSuccessHandler

java.lang.Object
org.springframework.security.oauth2.server.authorization.web.authentication.OAuth2AccessTokenResponseAuthenticationSuccessHandler
All Implemented Interfaces:
org.springframework.security.web.authentication.AuthenticationSuccessHandler

public final class OAuth2AccessTokenResponseAuthenticationSuccessHandler extends Object implements org.springframework.security.web.authentication.AuthenticationSuccessHandler
An implementation of an AuthenticationSuccessHandler used for handling an OAuth2AccessTokenAuthenticationToken and returning the Access Token Response.
Since:
1.3
See Also:
  • AuthenticationSuccessHandler
  • OAuth2AccessTokenResponseHttpMessageConverter
  • Constructor Details

    • OAuth2AccessTokenResponseAuthenticationSuccessHandler

      public OAuth2AccessTokenResponseAuthenticationSuccessHandler()
  • Method Details

    • onAuthenticationSuccess

      public void onAuthenticationSuccess(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.security.core.Authentication authentication) throws IOException, jakarta.servlet.ServletException
      Specified by:
      onAuthenticationSuccess in interface org.springframework.security.web.authentication.AuthenticationSuccessHandler
      Throws:
      IOException
      jakarta.servlet.ServletException
    • setAccessTokenResponseCustomizer

      public void setAccessTokenResponseCustomizer(Consumer<OAuth2AccessTokenAuthenticationContext> accessTokenResponseCustomizer)
      Sets the Consumer providing access to the OAuth2AccessTokenAuthenticationContext containing an OAuth2AccessTokenResponse.Builder and additional context information.
      Parameters:
      accessTokenResponseCustomizer - the Consumer providing access to the OAuth2AccessTokenAuthenticationContext containing an OAuth2AccessTokenResponse.Builder