Class JWTAuthContextInfoProvider


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

      • JWTAuthContextInfoProvider

        public JWTAuthContextInfoProvider()
    • Method Detail

      • 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
      • getContextInfo

        @Produces
        @ApplicationScoped
        public JWTAuthContextInfo getContextInfo()