@Singleton public class TokenAuthenticationFetcher extends Object implements AuthenticationFetcher
HttpRequest
and if existing validated.
It uses the list of TokenReader
and TokenValidator
registered in the ApplicationContext.Modifier and Type | Field and Description |
---|---|
protected ApplicationEventPublisher |
eventPublisher |
static Integer |
ORDER
The order of the fetcher.
|
protected Collection<TokenReader> |
tokenReaders |
protected Collection<TokenValidator> |
tokenValidators |
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor and Description |
---|
TokenAuthenticationFetcher(Collection<TokenValidator> tokenValidators,
Collection<TokenReader> tokenReaders,
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<TokenReader> tokenReaders
protected final Collection<TokenValidator> tokenValidators
protected final ApplicationEventPublisher eventPublisher
public TokenAuthenticationFetcher(Collection<TokenValidator> tokenValidators, Collection<TokenReader> tokenReaders, ApplicationEventPublisher eventPublisher)
tokenValidators
- The list of TokenValidator
which attempt to validate the requesttokenReaders
- The list TokenReader
which attempt to read the requesteventPublisher
- The Application event publiserpublic Publisher<Authentication> fetchAuthentication(HttpRequest<?> request)
AuthenticationFetcher
Authentication
from a HttpRequest
being executed.fetchAuthentication
in interface AuthenticationFetcher
request
- HttpRequest
being executed.Authentication
if found