@Requires(property="micronaut.security.basic-auth.enabled",
notEquals="false")
@Singleton
public class BasicAuthAuthenticationFetcher
extends java.lang.Object
implements AuthenticationFetcher
AuthenticationFetcher that decodes a username
and password from the Authorization header and authenticates the credentials
against any AuthenticationProviders available.| Constructor and Description |
|---|
BasicAuthAuthenticationFetcher(Authenticator authenticator,
TokenConfiguration configuration) |
| Modifier and Type | Method and Description |
|---|---|
org.reactivestreams.Publisher<Authentication> |
fetchAuthentication(io.micronaut.http.HttpRequest<?> request)
Attempts to read an
Authentication from a HttpRequest being executed. |
java.util.Optional<UsernamePasswordCredentials> |
parseCredentials(java.lang.String authorization)
Deprecated.
|
public BasicAuthAuthenticationFetcher(Authenticator authenticator, TokenConfiguration configuration)
authenticator - The authenticator to authenticate the credentialsconfiguration - The basic authentication configurationpublic org.reactivestreams.Publisher<Authentication> fetchAuthentication(io.micronaut.http.HttpRequest<?> request)
AuthenticationFetcherAuthentication from a HttpRequest being executed.fetchAuthentication in interface AuthenticationFetcherrequest - HttpRequest being executed.Authentication if found@Deprecated @NonNull public java.util.Optional<UsernamePasswordCredentials> parseCredentials(@NonNull java.lang.String authorization)
authorization - Authorization HTTP Header valueUsernamePasswordCredentials or an empty optional if not possible.