Package io.smallrye.jwt.auth.principal
Class JWTCallerPrincipalFactory
java.lang.Object
io.smallrye.jwt.auth.principal.JWTCallerPrincipalFactory
- Direct Known Subclasses:
DefaultJWTCallerPrincipalFactory
The factory class that provides the token string to JWTCallerPrincipal parsing for a given implementation.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic 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.
-
Constructor Details
-
JWTCallerPrincipalFactory
public JWTCallerPrincipalFactory()
-
-
Method Details
-
instance
Obtain the JWTCallerPrincipalFactory that has been set or by using the ServiceLoader pattern.- Returns:
- the factory instance
- See Also:
-
setInstance
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.
-