Class BearerTokenAuthenticationEntryPoint

java.lang.Object
org.springframework.security.oauth2.server.resource.web.BearerTokenAuthenticationEntryPoint
All Implemented Interfaces:
AuthenticationEntryPoint

public final class BearerTokenAuthenticationEntryPoint extends Object implements AuthenticationEntryPoint
An AuthenticationEntryPoint implementation used to commence authentication of protected resource requests using BearerTokenAuthenticationFilter.

Uses information provided by BearerTokenError to set HTTP response status code and populate WWW-Authenticate HTTP header.

Since:
5.1
See Also:
  • Constructor Details

    • BearerTokenAuthenticationEntryPoint

      public BearerTokenAuthenticationEntryPoint()
  • Method Details

    • commence

      public void commence(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, AuthenticationException authException)
      Collect error details from the provided parameters and format according to RFC 6750, specifically error, error_description, error_uri, and scope.
      Specified by:
      commence in interface AuthenticationEntryPoint
      Parameters:
      request - that resulted in an AuthenticationException
      response - so that the user agent can begin authentication
      authException - that caused the invocation
    • setRealmName

      public void setRealmName(String realmName)
      Set the default realm name to use in the bearer token error response
      Parameters:
      realmName -