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 Summary
FieldsModifier and TypeFieldDescriptionprotected final org.elasticsearch.common.settings.SecureStringprotected final org.elasticsearch.common.settings.SecureStringprotected Stringprotected com.nimbusds.jose.JWSHeaderprotected com.nimbusds.jwt.JWTClaimsSetprotected byte[]protected Stringprotected com.nimbusds.jwt.SignedJWTprotected String -
Constructor Summary
ConstructorsConstructorDescriptionJwtAuthenticationToken(org.elasticsearch.common.settings.SecureString endUserSignedJwt, org.elasticsearch.common.settings.SecureString clientAuthorizationSharedSecret) Store a mandatory JWT and optional Shared Secret. -
Method Summary
Modifier and TypeMethodDescriptionvoidorg.elasticsearch.common.settings.SecureStringorg.elasticsearch.common.settings.SecureStringorg.elasticsearch.common.settings.SecureStringcom.nimbusds.jose.JWSHeadercom.nimbusds.jwt.JWTClaimsSetbyte[]com.nimbusds.jwt.SignedJWT
-
Field Details
-
endUserSignedJwt
protected final org.elasticsearch.common.settings.SecureString endUserSignedJwt -
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
-
audiencesClaim
-
subjectClaim
-
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
- Specified by:
principalin interfaceorg.elasticsearch.xpack.core.security.authc.AuthenticationToken
-
credentials
public org.elasticsearch.common.settings.SecureString credentials()- Specified by:
credentialsin interfaceorg.elasticsearch.xpack.core.security.authc.AuthenticationToken
-
getEndUserSignedJwt
public org.elasticsearch.common.settings.SecureString getEndUserSignedJwt() -
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
-
getAudiencesClaim
-
getSubjectClaim
-
clearCredentials
public void clearCredentials()- Specified by:
clearCredentialsin interfaceorg.elasticsearch.xpack.core.security.authc.AuthenticationToken
-