Package io.micronaut.security.token
Class TokenAuthenticationFetcher
java.lang.Object
io.micronaut.security.token.TokenAuthenticationFetcher
- All Implemented Interfaces:
- io.micronaut.core.order.Ordered,- AuthenticationFetcher
Attempts to retrieve a token form the 
HttpRequest and if existing validated.
 It uses a TokenResolver and the list of TokenValidator registered in the ApplicationContext.- Since:
- 1.0
- Author:
- Sergio del Amo, Graeme Rocher
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final IntegerThe order of the fetcher.protected final io.micronaut.context.event.ApplicationEventPublisher<TokenValidatedEvent>protected final Collection<TokenValidator>Fields inherited from interface io.micronaut.core.order.OrderedHIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
- 
Constructor SummaryConstructorsConstructorDescriptionTokenAuthenticationFetcher(Collection<TokenValidator> tokenValidators, TokenResolver tokenResolver, io.micronaut.context.event.ApplicationEventPublisher<TokenValidatedEvent> tokenValidatedEventPublisher) 
- 
Method SummaryModifier and TypeMethodDescriptionorg.reactivestreams.Publisher<Authentication>fetchAuthentication(io.micronaut.http.HttpRequest<?> request) Attempts to read anAuthenticationfrom aHttpRequestbeing executed.intgetOrder()
- 
Field Details- 
ORDERThe order of the fetcher.
- 
tokenValidators
- 
tokenValidatedEventPublisherprotected final io.micronaut.context.event.ApplicationEventPublisher<TokenValidatedEvent> tokenValidatedEventPublisher
 
- 
- 
Constructor Details- 
TokenAuthenticationFetcherpublic TokenAuthenticationFetcher(Collection<TokenValidator> tokenValidators, TokenResolver tokenResolver, io.micronaut.context.event.ApplicationEventPublisher<TokenValidatedEvent> tokenValidatedEventPublisher) - Parameters:
- tokenValidators- The list of- TokenValidatorwhich attempt to validate the request
- tokenResolver- The- TokenResolverwhich returns the first found token in the request.
- tokenValidatedEventPublisher- Application event publisher for- TokenValidatedEvent.
 
 
- 
- 
Method Details- 
fetchAuthenticationpublic org.reactivestreams.Publisher<Authentication> fetchAuthentication(io.micronaut.http.HttpRequest<?> request) Description copied from interface:AuthenticationFetcherAttempts to read anAuthenticationfrom aHttpRequestbeing executed.- Specified by:
- fetchAuthenticationin interface- AuthenticationFetcher
- Parameters:
- request-- HttpRequestbeing executed.
- Returns:
- Authenticationif found
 
- 
getOrderpublic int getOrder()- Specified by:
- getOrderin interface- io.micronaut.core.order.Ordered
 
 
-