Module io.inverno.mod.security.http
Class CookieTokenCredentialsExtractor<A extends ExchangeContext,B extends Exchange<A>>
java.lang.Object
io.inverno.mod.security.http.token.CookieTokenCredentialsExtractor<A,B>
- All Implemented Interfaces:
CredentialsExtractor<TokenCredentials,
A, B>
public class CookieTokenCredentialsExtractor<A extends ExchangeContext,B extends Exchange<A>>
extends Object
implements CredentialsExtractor<TokenCredentials,A,B>
A credentials extractor that extracts a token credentials stored in an HTTP cookie.
- Since:
- 1.5
- Author:
- Jeremy Kuhn
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates a cookie token credentials extractor with the default token cookie name.CookieTokenCredentialsExtractor
(String tokenCookie) Creates a cookie token credentials extractor with the specified token cookie name. -
Method Summary
Modifier and TypeMethodDescriptionExtracts credentials from the specified exchange.Returns the token credentials cookie name.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.inverno.mod.security.http.CredentialsExtractor
or
-
Field Details
-
DEFAULT_COOKIE_NAME
The default token cookie name:AUTH-TOKEN
.This constant is also used in
CookieTokenLoginSuccessHandler
andCookieTokenLogoutSuccessHandler
.- See Also:
-
-
Constructor Details
-
CookieTokenCredentialsExtractor
public CookieTokenCredentialsExtractor()Creates a cookie token credentials extractor with the default token cookie name.
-
CookieTokenCredentialsExtractor
Creates a cookie token credentials extractor with the specified token cookie name.
- Parameters:
tokenCookie
- the token cookie name
-
-
Method Details
-
getTokenCookie
Returns the token credentials cookie name.
- Returns:
- the token cookie name
-
extract
Description copied from interface:CredentialsExtractor
Extracts credentials from the specified exchange.
- Specified by:
extract
in interfaceCredentialsExtractor<TokenCredentials,
A extends ExchangeContext, B extends Exchange<A>> - Parameters:
exchange
- the exchange- Returns:
- a mono emitting the credentials or an empty mono if the exchange didn't provide any credentials
- Throws:
MalformedCredentialsException
- if credentials in the exchange are malformed
-