@Singleton public class TokenAuthenticationFetcher extends Object implements AuthenticationFetcher
HttpRequest and if existing validated.
It uses a TokenResolver and the list of TokenValidator registered in the ApplicationContext.| Modifier and Type | Field and Description |
|---|---|
protected ApplicationEventPublisher |
eventPublisher |
static Integer |
ORDER
The order of the fetcher.
|
protected Collection<TokenValidator> |
tokenValidators |
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE| Constructor and Description |
|---|
TokenAuthenticationFetcher(Collection<TokenValidator> tokenValidators,
Collection<TokenReader> tokenReaders,
ApplicationEventPublisher eventPublisher)
Deprecated.
Use
TokenAuthenticationFetcher(Collection, TokenResolver, ApplicationEventPublisher) instead.
A TokenResolver can be created using DefaultTokenResolver.DefaultTokenResolver(Collection). |
TokenAuthenticationFetcher(Collection<TokenValidator> tokenValidators,
TokenResolver tokenResolver,
ApplicationEventPublisher eventPublisher) |
| Modifier and Type | Method and Description |
|---|---|
Publisher<Authentication> |
fetchAuthentication(HttpRequest<?> request)
Attempts to read an
Authentication from a HttpRequest being executed. |
int |
getOrder() |
public static final Integer ORDER
protected final Collection<TokenValidator> tokenValidators
protected final ApplicationEventPublisher eventPublisher
@Inject public TokenAuthenticationFetcher(Collection<TokenValidator> tokenValidators, TokenResolver tokenResolver, ApplicationEventPublisher eventPublisher)
tokenValidators - The list of TokenValidator which attempt to validate the requesttokenResolver - The TokenResolver which returns the first found token in the request.eventPublisher - The Application event publisher@Deprecated public TokenAuthenticationFetcher(Collection<TokenValidator> tokenValidators, Collection<TokenReader> tokenReaders, ApplicationEventPublisher eventPublisher)
TokenAuthenticationFetcher(Collection, TokenResolver, ApplicationEventPublisher) instead.
A TokenResolver can be created using DefaultTokenResolver.DefaultTokenResolver(Collection).tokenValidators - The list of TokenValidator which attempt to validate the requesttokenReaders - The list TokenReader which attempt to read the requesteventPublisher - The Application event publisherpublic Publisher<Authentication> fetchAuthentication(HttpRequest<?> request)
AuthenticationFetcherAuthentication from a HttpRequest being executed.fetchAuthentication in interface AuthenticationFetcherrequest - HttpRequest being executed.Authentication if found