Class 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 Detail

      • JWTCallerPrincipal

        public JWTCallerPrincipal​(String rawToken,
                                  String tokenType)
        Create a JWTCallerPrincipal with the caller's name
        Parameters:
        rawToken - - raw token value
        tokenType - - token type
    • Method Detail

      • getName

        public String getName()
        Specified by:
        getName in interface org.eclipse.microprofile.jwt.JsonWebToken
        Specified by:
        getName in interface Principal
      • getClaimNames

        public Set<String> getClaimNames()
        Specified by:
        getClaimNames in interface org.eclipse.microprofile.jwt.JsonWebToken
      • getClaim

        public <T> T getClaim​(String claimName)
        Specified by:
        getClaim in interface org.eclipse.microprofile.jwt.JsonWebToken
      • getClaimValue

        protected abstract Object getClaimValue​(String claimName)
      • 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)