Class BasicAuthAuthenticationFetcher<B>
java.lang.Object
io.micronaut.security.authentication.BasicAuthAuthenticationFetcher<B>
- Type Parameters:
B
- The HTTP Request Body type
- All Implemented Interfaces:
io.micronaut.core.order.Ordered
,AuthenticationFetcher<io.micronaut.http.HttpRequest<B>>
@Requires(classes=io.micronaut.http.HttpRequest.class) @Requires(property="micronaut.security.basic-auth.enabled",notEquals="false")
@Singleton
public class BasicAuthAuthenticationFetcher<B>
extends Object
implements AuthenticationFetcher<io.micronaut.http.HttpRequest<B>>
An implementation of
AuthenticationFetcher
that decodes a username
and password from the Authorization header and authenticates the credentials
against any ReactiveAuthenticationProvider
s available.-
Field Summary
Fields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
ConstructorDescriptionBasicAuthAuthenticationFetcher
(Authenticator<io.micronaut.http.HttpRequest<B>> authenticator) -
Method Summary
Modifier and TypeMethodDescriptionorg.reactivestreams.Publisher<Authentication>
fetchAuthentication
(io.micronaut.http.HttpRequest<B> request) Attempts to read anAuthentication
from an HTTP Request being executed.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.micronaut.core.order.Ordered
getOrder
-
Constructor Details
-
BasicAuthAuthenticationFetcher
public BasicAuthAuthenticationFetcher(Authenticator<io.micronaut.http.HttpRequest<B>> authenticator) - Parameters:
authenticator
- The authenticator to authenticate the credentials
-
-
Method Details
-
fetchAuthentication
public org.reactivestreams.Publisher<Authentication> fetchAuthentication(io.micronaut.http.HttpRequest<B> request) Description copied from interface:AuthenticationFetcher
Attempts to read anAuthentication
from an HTTP Request being executed.- Specified by:
fetchAuthentication
in interfaceAuthenticationFetcher<B>
- Parameters:
request
- an HTTP Request being executed.- Returns:
Authentication
if found
-