Package io.smallrye.jwt.auth
Class AbstractBearerTokenExtractor
java.lang.Object
io.smallrye.jwt.auth.AbstractBearerTokenExtractor
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 Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractBearerTokenExtractor(JWTAuthContextInfo authContextInfo) -
Method Summary
Modifier and TypeMethodDescriptionFind a JWT Bearer token in the request by referencing the configurations found in theJWTAuthContextInfo.protected abstract StringgetCookieValue(String cookieName) Retrieve an HTTP request cookie value by name.protected abstract StringgetHeaderValue(String headerName) Retrieve an HTTP request header by name.
-
Field Details
-
AUTHORIZATION_HEADER
- See Also:
-
COOKIE_HEADER
- See Also:
-
BEARER
- See Also:
-
BEARER_SCHEME_PREFIX
- See Also:
-
-
Constructor Details
-
AbstractBearerTokenExtractor
-
-
Method Details
-
getBearerToken
Find a JWT Bearer token in the request by referencing the configurations found in theJWTAuthContextInfo. 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
Retrieve an HTTP request header by name.- Parameters:
headerName- name of the header- Returns:
- value of the header
-
getCookieValue
Retrieve an HTTP request cookie value by name.- Parameters:
cookieName- name of the cookie- Returns:
- value of the cookie
-