Class CognitoPrincipal

  • All Implemented Interfaces:
    Principal, org.eclipse.microprofile.jwt.JsonWebToken

    public class CognitoPrincipal
    extends Object
    implements org.eclipse.microprofile.jwt.JsonWebToken
    Represents a Cognito JWT used to authenticate request Will only be allocated if requestContext.authorizer.jwt.claims.cognito:username is set in the http event sent by API Gateway
    • Constructor Detail

      • CognitoPrincipal

        public CognitoPrincipal​(com.amazonaws.services.lambda.runtime.events.APIGatewayV2HTTPEvent.RequestContext.Authorizer.JWT jwt)
    • 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
      • getAudience

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

        public long getExpirationTime()
        Specified by:
        getExpirationTime in interface org.eclipse.microprofile.jwt.JsonWebToken
      • getIssuedAtTime

        public long getIssuedAtTime()
        Specified by:
        getIssuedAtTime in interface org.eclipse.microprofile.jwt.JsonWebToken
      • getGroups

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

        public com.amazonaws.services.lambda.runtime.events.APIGatewayV2HTTPEvent.RequestContext.Authorizer.JWT getClaims()