Class TokenClaimsSet

    • Constructor Detail

      • TokenClaimsSet

        protected TokenClaimsSet()
        Default constructor for some subclasses.
      • TokenClaimsSet

        protected TokenClaimsSet​(@Nonnull
                                 com.nimbusds.jwt.JWTClaimsSet jwt)
        Constructor.
        Parameters:
        jwt - the claim set to wrap
        Since:
        3.1.0
    • Method Detail

      • verifyParsedClaims

        protected static void verifyParsedClaims​(@Nonnull @NotEmpty
                                                 String tokenType,
                                                 @Nonnull
                                                 com.nimbusds.jwt.JWTClaimsSet tokenClaimsSet)
                                          throws ParseException
        Helper to verify parsed claims are what is expected.
        Parameters:
        tokenType - The type of the expected token
        tokenClaimsSet - token claims set
        Throws:
        ParseException - if claims set is not expected one.
      • serialize

        @Nonnull
        @NotEmpty
        public String serialize()
        Serialize the token as JSON String.
        Returns:
        token as JSON String
      • serialize

        @Nonnull
        public String serialize​(@Nonnull
                                DataSealer dataSealer)
                         throws DataSealerException
        Serialize the token as JSON String wrapped with sealer.
        Parameters:
        dataSealer - data sealer to wrap the JSON serialization
        Returns:
        token as JSON String wrapped with sealer
        Throws:
        DataSealerException - is thrown if unwrapping fails
      • setClaimsSet

        public void setClaimsSet​(@Nonnull
                                 com.nimbusds.jwt.JWTClaimsSet claimsSet)
        Set the token claims set.
        Parameters:
        claimsSet - What to set
      • getClaimsSet

        @Nullable
        public com.nimbusds.jwt.JWTClaimsSet getClaimsSet()
        Get the token claims set.
        Returns:
        token claims set
      • getIssuer

        @Nonnull
        @NotEmpty
        public String getIssuer()
        Get the issuer.
        Returns:
        issuer
        Since:
        3.1.0
      • getIssuedAt

        @Nonnull
        public Instant getIssuedAt()
        Get issuance time of the token.
        Returns:
        issuance time
        Since:
        3.1.0
      • getExp

        @Nonnull
        public Instant getExp()
        Get expiration time of the token.
        Returns:
        expiration time of the token
      • getNotBefore

        @Nullable
        public Instant getNotBefore()
        Get not before time of the token, if any.
        Returns:
        not before time of the token
        Since:
        3.1.0
      • isExpired

        @Deprecated(since="3.1.0",
                    forRemoval=true)
        public boolean isExpired()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Check if the token is expired.

        Replaced by isTimeValid() method that enforces both bounds.

        Returns:
        true if the token is expired, otherwise false
      • isTimeValid

        public boolean isTimeValid()
        Check if the token is valid with respect to expiration and not before limits.
        Returns:
        true iff token is time valid
        Since:
        3.1.0
      • getRedirectURI

        @Nullable
        public URI getRedirectURI()
        Get redirect uri of the request.
        Returns:
        redirect uri of the request, null if not located.
      • getACR

        @Nullable
        public String getACR()
        Get acr of the performed authentication.
        Returns:
        acr of the performed authentication.
      • getType

        @Nullable
        public String getType()
        Get type of the claims set.
        Returns:
        Type of the claims set.
      • getPrincipal

        @Nullable
        public String getPrincipal()
        Get principal of the user.
        Returns:
        principal of the user.
      • getSubject

        @Nullable
        public String getSubject()
        Get subject claim.
        Returns:
        subject claim
        Since:
        3.1.0
      • getAuthenticationTime

        @Nullable
        public Instant getAuthenticationTime()
        Get auth time of the user.
        Returns:
        auth time of the user.
      • getNonce

        @Nullable
        public com.nimbusds.openid.connect.sdk.Nonce getNonce()
        Get nonce of the authentication request.
        Returns:
        nonce of the authentication request.
      • getClaimsRequest

        @Nullable
        public com.nimbusds.openid.connect.sdk.OIDCClaimsRequest getClaimsRequest()
        Get claims request of the authentication request.
        Returns:
        claims request in authentication request, null if not existing.
      • getDeliveryClaims

        @Nullable
        public com.nimbusds.openid.connect.sdk.claims.ClaimsSet getDeliveryClaims()
        Get token delivery claims.
        Returns:
        token delivery claims
      • getIDTokenDeliveryClaims

        @Nullable
        public com.nimbusds.openid.connect.sdk.claims.ClaimsSet getIDTokenDeliveryClaims()
        Get id token token delivery claims.
        Returns:
        id token token delivery claims
      • getUserinfoDeliveryClaims

        @Nullable
        public com.nimbusds.openid.connect.sdk.claims.ClaimsSet getUserinfoDeliveryClaims()
        Get user info response token delivery claims.
        Returns:
        user info response token delivery claims
      • getConsentedClaims

        @Nullable
        @NonnullElements
        public List<Object> getConsentedClaims()
        Get consented claims.
        Returns:
        consented claims
      • isConsentEnabled

        public boolean isConsentEnabled()
        Get whether consent has been enabled.
        Returns:
        whether consent has been enabled
      • getScope

        @Nullable
        public com.nimbusds.oauth2.sdk.Scope getScope()
        Get scope of the token.
        Returns:
        scope of the token
      • getCodeChallenge

        @Nullable
        public String getCodeChallenge()
        Get code challenge of the authentication request.
        Returns:
        code challenge of the authentication request.
      • getID

        @Nullable
        public String getID()
        Get the id of the token.
        Returns:
        id of the token
      • getClientID

        @Nullable
        public com.nimbusds.oauth2.sdk.id.ClientID getClientID()
        Get Client ID of the token.
        Returns:
        Client ID of the token