use of io.micronaut.security.token.jwt.signature.jwks.JwksSignature in project micronaut-security by micronaut-projects.
the class DefaultOpenIdTokenResponseValidator method jwksSignatureForOpenIdProviderMetadata.
/**
* @param openIdProviderMetadata The OpenID provider metadata
* @return A {@link JwksSignature} for the OpenID provider JWKS uri.
*/
protected JwksSignature jwksSignatureForOpenIdProviderMetadata(@NonNull OpenIdProviderMetadata openIdProviderMetadata) {
final String jwksuri = openIdProviderMetadata.getJwksUri();
if (!jwksSignatures.containsKey(jwksuri)) {
JwksSignatureConfigurationProperties config = new JwksSignatureConfigurationProperties();
config.setUrl(openIdProviderMetadata.getJwksUri());
jwksSignatures.put(jwksuri, new JwksSignature(config, jwkValidator));
}
return jwksSignatures.get(jwksuri);
}
use of io.micronaut.security.token.jwt.signature.jwks.JwksSignature in project micronaut-security by micronaut-projects.
the class JwksUriSignatureFactory method createJwksUriSignature.
/**
* @param openIdProviderMetadata The open id provider metadata
* @param jwkValidator JWK Validator
* @return a {@link JwksSignature} pointed to the jwks_uri exposed via OpenID configuration
*/
@Requires(property = SecurityConfigurationProperties.PREFIX + ".authentication", value = "idtoken")
@EachBean(DefaultOpenIdProviderMetadata.class)
public JwksSignature createJwksUriSignature(@Parameter BeanProvider<DefaultOpenIdProviderMetadata> openIdProviderMetadata, JwkValidator jwkValidator) {
JwksSignatureConfigurationProperties jwksSignatureConfiguration = new JwksSignatureConfigurationProperties();
jwksSignatureConfiguration.setUrl(openIdProviderMetadata.get().getJwksUri());
return new JwksSignature(jwksSignatureConfiguration, jwkValidator);
}
Aggregations