Class JmixOidcIdTokenDecoderFactory

java.lang.Object
io.jmix.oidc.jwt.JmixOidcIdTokenDecoderFactory
All Implemented Interfaces:
org.springframework.security.oauth2.jwt.JwtDecoderFactory<org.springframework.security.oauth2.client.registration.ClientRegistration>

public class JmixOidcIdTokenDecoderFactory extends Object implements org.springframework.security.oauth2.jwt.JwtDecoderFactory<org.springframework.security.oauth2.client.registration.ClientRegistration>
A JwtDecoderFactory used by OpenID Connect login for verifying ID token signatures with the keys from the provider JWK Set endpoint.

Reproduces the behavior of the standard OidcIdTokenDecoderFactory with the default RS256 algorithm, except that the JWK Set is loaded using the given RestOperations, which allows configuring HTTP timeouts instead of the 500 ms defaults applied by Spring Security. Created decoders are cached per client registration id, so the JWK Set cache inside the decoder is reused between logins.

  • Field Details

    • MISSING_SIGNATURE_VERIFIER_ERROR_CODE

      protected static final String MISSING_SIGNATURE_VERIFIER_ERROR_CODE
      See Also:
    • restOperations

      protected final org.springframework.web.client.RestOperations restOperations
    • jwtDecoders

      protected final Map<String,org.springframework.security.oauth2.jwt.JwtDecoder> jwtDecoders
  • Constructor Details

    • JmixOidcIdTokenDecoderFactory

      public JmixOidcIdTokenDecoderFactory(org.springframework.web.client.RestOperations restOperations)
  • Method Details

    • createDecoder

      public org.springframework.security.oauth2.jwt.JwtDecoder createDecoder(org.springframework.security.oauth2.client.registration.ClientRegistration clientRegistration)
      Specified by:
      createDecoder in interface org.springframework.security.oauth2.jwt.JwtDecoderFactory<org.springframework.security.oauth2.client.registration.ClientRegistration>
    • buildDecoder

      protected org.springframework.security.oauth2.jwt.JwtDecoder buildDecoder(org.springframework.security.oauth2.client.registration.ClientRegistration clientRegistration)