Module org.elasticsearch.xcore
Class ServiceAccountToken
java.lang.Object
org.elasticsearch.xpack.core.security.authc.service.ServiceAccountToken
- All Implemented Interfaces:
Closeable,AutoCloseable,AuthenticationToken
A decoded credential that may be used to authenticate a
ServiceAccount.
It consists of:
- A
service account token ID - The
secret credentialfor that token
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final bytestatic final bytestatic final byte[]static final bytestatic final byte -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidclose()booleanstatic ServiceAccountTokenfromBearerString(SecureString bearerString) inthashCode()static ServiceAccountTokennewToken(ServiceAccount.ServiceAccountId accountId, String tokenName) toString()
-
Field Details
-
MAGIC_BYTE
public static final byte MAGIC_BYTE- See Also:
-
TOKEN_TYPE
public static final byte TOKEN_TYPE- See Also:
-
RESERVED_BYTE
public static final byte RESERVED_BYTE- See Also:
-
FORMAT_VERSION
public static final byte FORMAT_VERSION- See Also:
-
PREFIX
public static final byte[] PREFIX
-
-
Method Details
-
getTokenId
-
getSecret
-
getAccountId
-
getTokenName
-
getQualifiedName
-
asBearerString
- Throws:
IOException
-
fromBearerString
- Throws:
IOException
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
toString
-
equals
-
hashCode
public int hashCode() -
newToken
public static ServiceAccountToken newToken(ServiceAccount.ServiceAccountId accountId, String tokenName) -
principal
- Specified by:
principalin interfaceAuthenticationToken
-
credentials
- Specified by:
credentialsin interfaceAuthenticationToken
-
clearCredentials
public void clearCredentials()- Specified by:
clearCredentialsin interfaceAuthenticationToken
-