@Singleton public class X509AuthenticationFetcher extends java.lang.Object implements AuthenticationFetcher
Modifier and Type | Field and Description |
---|---|
static int |
ORDER
The order of the fetcher.
|
Constructor and Description |
---|
X509AuthenticationFetcher(X509Configuration x509Configuration) |
Modifier and Type | Method and Description |
---|---|
protected java.util.Optional<Authentication> |
createAuthentication(io.micronaut.http.HttpRequest<?> request)
Creates an
X509Authentication from information in an X509Certificate
if one is present in the request. |
protected java.util.Optional<Authentication> |
createX509Authentication(java.security.cert.X509Certificate certificate)
Creates an
X509Authentication from information in an X509Certificate . |
protected java.util.Optional<java.lang.String> |
extractName(java.security.cert.X509Certificate certificate)
Extracts the name from the certificate using the subject DN regex.
|
org.reactivestreams.Publisher<Authentication> |
fetchAuthentication(io.micronaut.http.HttpRequest<?> request)
Attempts to read an
Authentication from a HttpRequest being executed. |
int |
getOrder() |
public X509AuthenticationFetcher(X509Configuration x509Configuration)
x509Configuration
- x509 configurationpublic int getOrder()
getOrder
in interface io.micronaut.core.order.Ordered
public org.reactivestreams.Publisher<Authentication> fetchAuthentication(io.micronaut.http.HttpRequest<?> request)
AuthenticationFetcher
Authentication
from a HttpRequest
being executed.fetchAuthentication
in interface AuthenticationFetcher
request
- HttpRequest
being executed.Authentication
if found@NonNull protected java.util.Optional<Authentication> createAuthentication(io.micronaut.http.HttpRequest<?> request)
X509Authentication
from information in an X509Certificate
if one is present in the request.request
- the request@NonNull protected java.util.Optional<Authentication> createX509Authentication(@NonNull java.security.cert.X509Certificate certificate)
X509Authentication
from information in an X509Certificate
.certificate
- the certificate@NonNull protected java.util.Optional<java.lang.String> extractName(@NonNull java.security.cert.X509Certificate certificate)
certificate
- the client certificate