Class DefaultServerBearerTokenResolver

java.lang.Object
com.power4j.fist.boot.security.oauth2.DefaultServerBearerTokenResolver
All Implemented Interfaces:
ServerBearerTokenResolver

public class DefaultServerBearerTokenResolver extends Object implements ServerBearerTokenResolver
Since:
1.0
Author:
CJ (power4j@outlook.com)
  • Constructor Details

    • DefaultServerBearerTokenResolver

      public DefaultServerBearerTokenResolver()
  • Method Details

    • resolve

      @Nullable public String resolve(org.springframework.http.server.reactive.ServerHttpRequest request)
      Description copied from interface: ServerBearerTokenResolver
      Resolve any Bearer Token value from the request.
      Specified by:
      resolve in interface ServerBearerTokenResolver
      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 to false. 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

      public void setBearerTokenHeaderName(String bearerTokenHeaderName)
      Set this value to configure what header is checked when resolving a Bearer Token. This value is defaulted to HttpHeaders.AUTHORIZATION. This allows other headers to be used as the Bearer Token source such as HttpHeaders.PROXY_AUTHORIZATION
      Parameters:
      bearerTokenHeaderName - the header to check when retrieving the Bearer Token.
      Since:
      5.4