Class DefaultServerBearerTokenResolver
java.lang.Object
com.power4j.fist.boot.security.oauth2.DefaultServerBearerTokenResolver
- All Implemented Interfaces:
ServerBearerTokenResolver
- Since:
- 1.0
- Author:
- CJ (power4j@outlook.com)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionresolve(org.springframework.http.server.reactive.ServerHttpRequest request) Resolve any Bearer Token value from the request.voidsetAllowUriQueryParameter(boolean allowUriQueryParameter) Set if transport of access token using URI query parameter is supported.voidsetBearerTokenHeaderName(String bearerTokenHeaderName) Set this value to configure what header is checked when resolving a Bearer Token.
-
Constructor Details
-
DefaultServerBearerTokenResolver
public DefaultServerBearerTokenResolver()
-
-
Method Details
-
resolve
Description copied from interface:ServerBearerTokenResolverResolve any Bearer Token value from the request.- Specified by:
resolvein interfaceServerBearerTokenResolver- Parameters:
request- the request- Returns:
- the Bearer Token value or null if none found
-
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
-
setBearerTokenHeaderName
Set this value to configure what header is checked when resolving a Bearer Token. This value is defaulted toHttpHeaders.AUTHORIZATION. This allows other headers to be used as the Bearer Token source such asHttpHeaders.PROXY_AUTHORIZATION- Parameters:
bearerTokenHeaderName- the header to check when retrieving the Bearer Token.- Since:
- 5.4
-