Class JWTCallerPrincipalFactory

java.lang.Object
io.smallrye.jwt.auth.principal.JWTCallerPrincipalFactory
Direct Known Subclasses:
DefaultJWTCallerPrincipalFactory

public abstract class JWTCallerPrincipalFactory extends Object
The factory class that provides the token string to JWTCallerPrincipal parsing for a given implementation.
  • Constructor Details

    • JWTCallerPrincipalFactory

      public JWTCallerPrincipalFactory()
  • Method Details

    • instance

      public static JWTCallerPrincipalFactory instance()
      Obtain the JWTCallerPrincipalFactory that has been set or by using the ServiceLoader pattern.
      Returns:
      the factory instance
      See Also:
    • setInstance

      public static void setInstance(JWTCallerPrincipalFactory resolver)
      Set the instance. It is used by OSGi environment where service loader pattern is not supported.
      Parameters:
      resolver - the instance to use.
    • parse

      public abstract JWTCallerPrincipal parse(String token, JWTAuthContextInfo authContextInfo) throws ParseException
      Parse the given bearer token string into a JWTCallerPrincipal instance.
      Parameters:
      token - - the bearer token provided for authorization
      authContextInfo - - context/configuration details
      Returns:
      A JWTCallerPrincipal representation for the token.
      Throws:
      ParseException - on parse or verification failure.