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 SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidcommence(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, specificallyerror,error_description,error_uri, andscope.voidsetRealmName(String realmName) Set the default realm name to use in the bearer token error response
- 
Constructor Details- 
BearerTokenAuthenticationEntryPointpublic BearerTokenAuthenticationEntryPoint()
 
- 
- 
Method Details- 
commencepublic 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, specificallyerror,error_description,error_uri, andscope.- Specified by:
- commencein interface- AuthenticationEntryPoint
- Parameters:
- request- that resulted in an- AuthenticationException
- response- so that the user agent can begin authentication
- authException- that caused the invocation
 
- 
setRealmNameSet the default realm name to use in the bearer token error response- Parameters:
- realmName-
 
 
-