Package io.smallrye.jwt.auth.principal
Class DefaultJWTCallerPrincipal
- java.lang.Object
-
- io.smallrye.jwt.auth.principal.JWTCallerPrincipal
-
- io.smallrye.jwt.auth.principal.DefaultJWTCallerPrincipal
-
- All Implemented Interfaces:
Principal,org.eclipse.microprofile.jwt.JsonWebToken
public class DefaultJWTCallerPrincipal extends JWTCallerPrincipal
A default implementation of JWTCallerPrincipal that wraps the jose4j JwtClaims.- See Also:
JwtClaims
-
-
Constructor Summary
Constructors Constructor Description DefaultJWTCallerPrincipal(String rawToken, String tokenType, org.jose4j.jwt.JwtClaims claimsSet)Create the DefaultJWTCallerPrincipal from the parsed JWT token and the extracted principal nameDefaultJWTCallerPrincipal(String tokenType, org.jose4j.jwt.JwtClaims claimsSet)DefaultJWTCallerPrincipal(org.jose4j.jwt.JwtClaims claimsSet)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Collection<String>doGetClaimNames()protected Set<String>filterCustomClaimNames(Collection<String> claimNames)Determine the custom claims in the setSet<String>getAudience()protected ObjectgetClaimValue(String claimName)Set<String>getGroups()protected static StringgetRawToken(org.jose4j.jwt.JwtClaims claimsSet)protected voidreplaceClaimValueWithJsonValue(String name)-
Methods inherited from class io.smallrye.jwt.auth.principal.JWTCallerPrincipal
getClaim, getClaimNames, getClaimType, getName, implies, toString, toString, wrapClaimValue
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
-
-
-
Constructor Detail
-
DefaultJWTCallerPrincipal
public DefaultJWTCallerPrincipal(String rawToken, String tokenType, org.jose4j.jwt.JwtClaims claimsSet)
Create the DefaultJWTCallerPrincipal from the parsed JWT token and the extracted principal name- Parameters:
rawToken- - raw token valuetokenType- - token typeclaimsSet- - Jose4J claims set
-
DefaultJWTCallerPrincipal
public DefaultJWTCallerPrincipal(String tokenType, org.jose4j.jwt.JwtClaims claimsSet)
-
DefaultJWTCallerPrincipal
public DefaultJWTCallerPrincipal(org.jose4j.jwt.JwtClaims claimsSet)
-
-
Method Detail
-
getRawToken
protected static String getRawToken(org.jose4j.jwt.JwtClaims claimsSet)
-
doGetClaimNames
protected Collection<String> doGetClaimNames()
- Specified by:
doGetClaimNamesin classJWTCallerPrincipal
-
getClaimValue
protected Object getClaimValue(String claimName)
- Specified by:
getClaimValuein classJWTCallerPrincipal
-
filterCustomClaimNames
protected Set<String> filterCustomClaimNames(Collection<String> claimNames)
Determine the custom claims in the set- Parameters:
claimNames- - the current set of claim names in this token- Returns:
- the possibly empty set of names for non-Claims claims
-
replaceClaimValueWithJsonValue
protected void replaceClaimValueWithJsonValue(String name)
-
-