Package io.smallrye.jwt.auth.principal
Class JWTCallerPrincipal
- java.lang.Object
-
- io.smallrye.jwt.auth.principal.JWTCallerPrincipal
-
- All Implemented Interfaces:
Principal
,org.eclipse.microprofile.jwt.JsonWebToken
- Direct Known Subclasses:
DefaultJWTCallerPrincipal
public abstract class JWTCallerPrincipal extends Object implements org.eclipse.microprofile.jwt.JsonWebToken
An abstract CallerPrincipal implementation that provides access to the JWT claims that are required by the microprofile token.
-
-
Constructor Summary
Constructors Constructor Description JWTCallerPrincipal(String rawToken, String tokenType)
Create a JWTCallerPrincipal with the caller's name
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract Collection<String>
doGetClaimNames()
<T> T
getClaim(String claimName)
Set<String>
getClaimNames()
protected org.eclipse.microprofile.jwt.Claims
getClaimType(String claimName)
protected abstract Object
getClaimValue(String claimName)
String
getName()
boolean
implies(Subject subject)
String
toString()
String
toString(boolean showAll)
TODO: showAll is ignored and currently assumed trueprotected jakarta.json.JsonValue
wrapClaimValue(Object value)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
-
-
-
Method Detail
-
getName
public String getName()
-
getClaimNames
public Set<String> getClaimNames()
- Specified by:
getClaimNames
in interfaceorg.eclipse.microprofile.jwt.JsonWebToken
-
doGetClaimNames
protected abstract Collection<String> doGetClaimNames()
-
getClaim
public <T> T getClaim(String claimName)
- Specified by:
getClaim
in interfaceorg.eclipse.microprofile.jwt.JsonWebToken
-
toString
public String toString()
-
toString
public String toString(boolean showAll)
TODO: showAll is ignored and currently assumed true- Parameters:
showAll
- - should all claims associated with the JWT be displayed or should only those defined in the JsonWebToken interface be displayed.- Returns:
- JWTCallerPrincipal string view
-
wrapClaimValue
protected jakarta.json.JsonValue wrapClaimValue(Object value)
-
getClaimType
protected org.eclipse.microprofile.jwt.Claims getClaimType(String claimName)
-
-