Class JWTAuthContextInfoProvider

java.lang.Object
io.smallrye.jwt.config.JWTAuthContextInfoProvider

@Dependent public class JWTAuthContextInfoProvider extends Object
A CDI provider for the JWTAuthContextInfo that obtains the necessary information from MP config properties.
  • Constructor Details

    • JWTAuthContextInfoProvider

      public JWTAuthContextInfoProvider()
  • Method Details

    • createWithKey

      public static JWTAuthContextInfoProvider createWithKey(String publicKey, String issuer)
      Create JWTAuthContextInfoProvider with the public key and issuer
      Parameters:
      publicKey - the public key value
      issuer - the issuer
      Returns:
      a new instance of JWTAuthContextInfoProvider
    • createWithDecryptionKey

      public static JWTAuthContextInfoProvider createWithDecryptionKey(String decryptionKey, String issuer)
      Create JWTAuthContextInfoProvider with the decryption key and issuer
      Parameters:
      decryptionKey - the decryption key value
      issuer - the issuer
      Returns:
      a new instance of JWTAuthContextInfoProvider
    • createWithKeyLocation

      public static JWTAuthContextInfoProvider createWithKeyLocation(String keyLocation, String issuer)
      Create JWTAuthContextInfoProvider with the verification public key location and issuer
      Parameters:
      keyLocation - the verification public key location
      issuer - the issuer
      Returns:
      a new instance of JWTAuthContextInfoProvider
    • createWithCertificate

      public static JWTAuthContextInfoProvider createWithCertificate(String keyLocation, String issuer)
      Create JWTAuthContextInfoProvider with the verification public key location and issuer. Tokens will be expected to contain either 'x5t' or 'x5t#S256' thumbprints.
      Parameters:
      keyLocation - certificate location which points to a PEM certificate or JWK containing the certificate chain
      issuer - the issuer
      Returns:
      a new instance of JWTAuthContextInfoProvider
    • createWithSecretKeyLocation

      public static JWTAuthContextInfoProvider createWithSecretKeyLocation(String keyLocation, String issuer)
      Create JWTAuthContextInfoProvider with the verification secret key location and issuer
      Parameters:
      keyLocation - the verification secret key location
      issuer - the issuer
      Returns:
      a new instance of JWTAuthContextInfoProvider
    • createWithVerifyKeyStoreLocation

      public static JWTAuthContextInfoProvider createWithVerifyKeyStoreLocation(String keyLocation, Optional<String> theKeyStorePassword, Optional<String> theKeyStoreVerifyKeyAlias, Optional<String> theKeyStoreDecryptKeyAlias, String issuer)
      Create JWTAuthContextInfoProvider with the keystore and issuer
    • createWithKeyStoreLocation

      public static JWTAuthContextInfoProvider createWithKeyStoreLocation(String keyLocation, Optional<String> theKeyStorePassword, Optional<String> theKeyStoreVerifyKeyAlias, Optional<String> theKeyStoreDecryptKeyAlias, String issuer)
      Create JWTAuthContextInfoProvider with the keystore and issuer
    • create

      public static JWTAuthContextInfoProvider create(String key, String keyLocation, boolean secretKey, boolean verifyCertificateThumbprint, String issuer, Optional<String> decryptionKey)
    • getContextInfo

      @Produces @ApplicationScoped public JWTAuthContextInfo getContextInfo()