Class AbstractBearerTokenExtractor

java.lang.Object
io.smallrye.jwt.auth.AbstractBearerTokenExtractor

public abstract class AbstractBearerTokenExtractor extends Object
Common functionality for classes extracting Bearer tokens from HTTP request headers (including Cookie) and converting the token string to a JsonWebToken.
Author:
Michael Edgar <michael@xlate.io>
  • Field Details

  • Constructor Details

    • AbstractBearerTokenExtractor

      protected AbstractBearerTokenExtractor(JWTAuthContextInfo authContextInfo)
  • Method Details

    • getBearerToken

      public String getBearerToken()
      Find a JWT Bearer token in the request by referencing the configurations found in the JWTAuthContextInfo. The resulting token may be found in a cookie or another HTTP header, either explicitly configured or the default 'Authorization' header.
      Returns:
      a JWT Bearer token or null if not found
    • getHeaderValue

      protected abstract String getHeaderValue(String headerName)
      Retrieve an HTTP request header by name.
      Parameters:
      headerName - name of the header
      Returns:
      value of the header
    • getCookieValue

      protected abstract String getCookieValue(String cookieName)
      Retrieve an HTTP request cookie value by name.
      Parameters:
      cookieName - name of the cookie
      Returns:
      value of the cookie