Class ServiceAccountToken
java.lang.Object
org.elasticsearch.xpack.security.authc.service.ServiceAccountToken
- All Implemented Interfaces:
Closeable,AutoCloseable,org.elasticsearch.xpack.core.security.authc.AuthenticationToken
public class ServiceAccountToken
extends Object
implements org.elasticsearch.xpack.core.security.authc.AuthenticationToken, Closeable
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 TypeMethodDescriptionorg.elasticsearch.common.settings.SecureStringvoidvoidclose()booleanstatic ServiceAccountTokenfromBearerString(org.elasticsearch.common.settings.SecureString bearerString) org.elasticsearch.common.settings.SecureStringinthashCode()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
public org.elasticsearch.common.settings.SecureString getSecret() -
getAccountId
-
getTokenName
-
getQualifiedName
-
asBearerString
- Throws:
IOException
-
fromBearerString
public static ServiceAccountToken fromBearerString(org.elasticsearch.common.settings.SecureString bearerString) throws IOException - 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 interfaceorg.elasticsearch.xpack.core.security.authc.AuthenticationToken
-
credentials
- Specified by:
credentialsin interfaceorg.elasticsearch.xpack.core.security.authc.AuthenticationToken
-
clearCredentials
public void clearCredentials()- Specified by:
clearCredentialsin interfaceorg.elasticsearch.xpack.core.security.authc.AuthenticationToken
-