Class DefaultBearerTokenResolver
- java.lang.Object
-
- org.springframework.security.oauth2.server.resource.web.DefaultBearerTokenResolver
-
- All Implemented Interfaces:
BearerTokenResolver
public final class DefaultBearerTokenResolver extends java.lang.Object implements BearerTokenResolver
The defaultBearerTokenResolver
implementation based on RFC 6750.- Since:
- 5.1
- See Also:
- RFC 6750 Section 2: Authenticated Requests
-
-
Constructor Summary
Constructors Constructor Description DefaultBearerTokenResolver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
resolve(javax.servlet.http.HttpServletRequest request)
Resolve any Bearer Token value from the request.void
setAllowFormEncodedBodyParameter(boolean allowFormEncodedBodyParameter)
Set if transport of access token using form-encoded body parameter is supported.void
setAllowUriQueryParameter(boolean allowUriQueryParameter)
Set if transport of access token using URI query parameter is supported.
-
-
-
Method Detail
-
resolve
public java.lang.String resolve(javax.servlet.http.HttpServletRequest request)
Resolve any Bearer Token value from the request.- Specified by:
resolve
in interfaceBearerTokenResolver
- Parameters:
request
- the request- Returns:
- the Bearer Token value or
null
if none found
-
setAllowFormEncodedBodyParameter
public void setAllowFormEncodedBodyParameter(boolean allowFormEncodedBodyParameter)
Set if transport of access token using form-encoded body parameter is supported. Defaults tofalse
.- Parameters:
allowFormEncodedBodyParameter
- if the form-encoded body parameter is supported
-
setAllowUriQueryParameter
public void setAllowUriQueryParameter(boolean allowUriQueryParameter)
Set if transport of access token using URI query parameter is supported. Defaults tofalse
. The spec recommends against using this mechanism for sending bearer tokens, and even goes as far as stating that it was only included for completeness.- Parameters:
allowUriQueryParameter
- if the URI query parameter is supported
-
-