Class BearerTokenAuthenticationEntryPoint
- java.lang.Object
-
- org.springframework.security.oauth2.server.resource.web.BearerTokenAuthenticationEntryPoint
-
- All Implemented Interfaces:
AuthenticationEntryPoint
public final class BearerTokenAuthenticationEntryPoint extends java.lang.Object implements AuthenticationEntryPoint
AnAuthenticationEntryPoint
implementation used to commence authentication of protected resource requests usingBearerTokenAuthenticationFilter
.Uses information provided by
BearerTokenError
to set HTTP response status code and populateWWW-Authenticate
HTTP header.- Since:
- 5.1
- See Also:
BearerTokenError
, RFC 6750 Section 3: The WWW-Authenticate Response Header Field
-
-
Constructor Summary
Constructors Constructor Description BearerTokenAuthenticationEntryPoint()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
commence(javax.servlet.http.HttpServletRequest request, javax.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
.void
setRealmName(java.lang.String realmName)
Set the default realm name to use in the bearer token error response
-
-
-
Method Detail
-
commence
public void commence(javax.servlet.http.HttpServletRequest request, javax.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:
commence
in interfaceAuthenticationEntryPoint
- Parameters:
request
- that resulted in anAuthenticationException
response
- so that the user agent can begin authenticationauthException
- that caused the invocation
-
setRealmName
public void setRealmName(java.lang.String realmName)
Set the default realm name to use in the bearer token error response- Parameters:
realmName
-
-
-