Class JwksUriSignatureFactory
java.lang.Object
io.micronaut.security.oauth2.client.JwksUriSignatureFactory
Factory to create
ReactiveJwksSignature beans for the OpenIdProviderMetadata.getJwksUri() of OpenID clients.
The beans are only created for the AuthenticationMode.IDTOKEN authentication mode, where the
ID token issued by the provider is the request credential. In any other authentication mode, tokens signed by the provider's keys, such
as ID tokens issued to other clients, must not authenticate requests. The ID token obtained during the authorization code flow is
validated against the provider's JWKS independently of these beans.
The key set of a provider is bound to the issuer of that provider (see JwksSignatureConfiguration.getIssuer()),
so that a token whose iss claim names one provider cannot be verified with the keys of another provider.
- Since:
- 1.3.0
- Author:
- Sergio del Amo
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateJwksSignatureConfiguration(OpenIdClientConfiguration openIdClientConfiguration, io.micronaut.context.BeanProvider<DefaultOpenIdProviderMetadata> openIdProviderMetadata)
-
Constructor Details
-
JwksUriSignatureFactory
public JwksUriSignatureFactory()
-
-
Method Details
-
createJwksSignatureConfiguration
@Requires(property="micronaut.security.authentication", value="idtoken") @EachBean(DefaultOpenIdProviderMetadata.class) public JwksSignatureConfiguration createJwksSignatureConfiguration(@Parameter OpenIdClientConfiguration openIdClientConfiguration, @Parameter io.micronaut.context.BeanProvider<DefaultOpenIdProviderMetadata> openIdProviderMetadata) - Parameters:
openIdClientConfiguration- The OpenID client configurationopenIdProviderMetadata- The open id provider metadata- Returns:
- a
JwksSignatureConfigurationpointed to the jwks_uri exposed via OpenID configuration and bound to the issuer of the OpenID client
-