Class HttpClientJwksClient
java.lang.Object
io.micronaut.security.token.jwt.signature.jwks.HttpClientJwksClient
- All Implemented Interfaces:
JwksClient
@Singleton
@Requires(classes=io.micronaut.http.client.HttpClient.class) @Requires(property="micronaut.security.token.jwt.signatures.jwks-client.http-client.enabled",value="true",defaultValue="true")
public class HttpClientJwksClient
extends Object
implements JwksClient
Implementation of
JwksClient
that uses the Micronaut HttpClient
.
If a named service-specific client is configured (i.e. with "micronaut.http.services.foo.*") with a name that matches the name used for security configuration (i.e. "micronaut.security.token.jwt.signatures.jwks.foo.*") then that client will be used for the request. Otherwise, a default client will be used.
- Since:
- 4.5.0
- Author:
- Jeremy Grelle
-
Constructor Summary
ConstructorDescriptionHttpClientJwksClient
(io.micronaut.context.BeanContext beanContext, io.micronaut.http.client.HttpClientRegistry<io.micronaut.http.client.HttpClient> clientRegistry, io.micronaut.http.client.HttpClientConfiguration defaultClientConfiguration) -
Method Summary
Modifier and TypeMethodDescriptionprotected io.micronaut.http.client.HttpClient
Retrieves an HTTP client for the given provider.org.reactivestreams.Publisher<String>
Loads remote Json Web Key Set content over http.
-
Constructor Details
-
HttpClientJwksClient
public HttpClientJwksClient(io.micronaut.context.BeanContext beanContext, io.micronaut.http.client.HttpClientRegistry<io.micronaut.http.client.HttpClient> clientRegistry, io.micronaut.http.client.HttpClientConfiguration defaultClientConfiguration) - Parameters:
beanContext
- BeanContextclientRegistry
- HTTP Client RegistrydefaultClientConfiguration
- Default HTTP Client Configuration
-
-
Method Details
-
load
@SingleResult public org.reactivestreams.Publisher<String> load(@Nullable @Nullable String providerName, @NonNull @NonNull String url) throws io.micronaut.http.client.exceptions.HttpClientException Description copied from interface:JwksClient
Loads remote Json Web Key Set content over http.- Specified by:
load
in interfaceJwksClient
- Parameters:
providerName
- The jwks provider nameurl
- The URL for loading the remote JWK Set- Returns:
- The JWK Set response body content
- Throws:
io.micronaut.http.client.exceptions.HttpClientException
-
getClient
Retrieves an HTTP client for the given provider.- Parameters:
providerName
- The provider name- Returns:
- An HTTP client to use to send the JWKS request
-