Class JwtAuthenticationToken

java.lang.Object
org.elasticsearch.xpack.security.authc.jwt.JwtAuthenticationToken
All Implemented Interfaces:
org.elasticsearch.xpack.core.security.authc.AuthenticationToken

public class JwtAuthenticationToken extends Object implements org.elasticsearch.xpack.core.security.authc.AuthenticationToken
An AuthenticationToken to hold JWT authentication related content.
  • Field Details

    • endUserSignedJwt

      protected final org.elasticsearch.common.settings.SecureString endUserSignedJwt
    • clientAuthorizationSharedSecret

      protected final org.elasticsearch.common.settings.SecureString clientAuthorizationSharedSecret
    • signedJwt

      protected com.nimbusds.jwt.SignedJWT signedJwt
    • jwsHeader

      protected com.nimbusds.jose.JWSHeader jwsHeader
    • jwtClaimsSet

      protected com.nimbusds.jwt.JWTClaimsSet jwtClaimsSet
    • jwtSignature

      protected byte[] jwtSignature
    • issuerClaim

      protected String issuerClaim
    • audiencesClaim

      protected List<String> audiencesClaim
    • subjectClaim

      protected String subjectClaim
    • principal

      protected String principal
  • Constructor Details

    • JwtAuthenticationToken

      public JwtAuthenticationToken(org.elasticsearch.common.settings.SecureString endUserSignedJwt, @Nullable org.elasticsearch.common.settings.SecureString clientAuthorizationSharedSecret)
      Store a mandatory JWT and optional Shared Secret. Parse the JWT, and extract the header, claims set, and signature. Throws IllegalArgumentException if bearerString is missing, or if JWT parsing fails.
      Parameters:
      endUserSignedJwt - Base64Url-encoded JWT for End-user authorization. Required by all JWT realms.
      clientAuthorizationSharedSecret - URL-safe Shared Secret for Client authorization. Required by some JWT realms.
  • Method Details

    • principal

      public String principal()
      Specified by:
      principal in interface org.elasticsearch.xpack.core.security.authc.AuthenticationToken
    • credentials

      public org.elasticsearch.common.settings.SecureString credentials()
      Specified by:
      credentials in interface org.elasticsearch.xpack.core.security.authc.AuthenticationToken
    • getEndUserSignedJwt

      public org.elasticsearch.common.settings.SecureString getEndUserSignedJwt()
    • getClientAuthorizationSharedSecret

      public org.elasticsearch.common.settings.SecureString getClientAuthorizationSharedSecret()
    • getSignedJwt

      public com.nimbusds.jwt.SignedJWT getSignedJwt()
    • getJwsHeader

      public com.nimbusds.jose.JWSHeader getJwsHeader()
    • getJwtClaimsSet

      public com.nimbusds.jwt.JWTClaimsSet getJwtClaimsSet()
    • getSignatureBytes

      public byte[] getSignatureBytes()
    • getIssuerClaim

      public String getIssuerClaim()
    • getAudiencesClaim

      public List<String> getAudiencesClaim()
    • getSubjectClaim

      public String getSubjectClaim()
    • clearCredentials

      public void clearCredentials()
      Specified by:
      clearCredentials in interface org.elasticsearch.xpack.core.security.authc.AuthenticationToken