Package io.smallrye.jwt.auth.principal
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 Summary
Constructors Constructor Description JWTCallerPrincipalFactory()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static JWTCallerPrincipalFactoryinstance()Obtain the JWTCallerPrincipalFactory that has been set or by using the ServiceLoader pattern.abstract JWTCallerPrincipalparse(String token, JWTAuthContextInfo authContextInfo)Parse the given bearer token string into a JWTCallerPrincipal instance.static voidsetInstance(JWTCallerPrincipalFactory resolver)Set the instance.
-
-
-
Method Detail
-
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(JWTCallerPrincipalFactory)
-
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 authorizationauthContextInfo- - context/configuration details- Returns:
- A JWTCallerPrincipal representation for the token.
- Throws:
ParseException- on parse or verification failure.
-
-