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:
  1. A service account token ID
  2. The secret credential for that token
  • Field Details

  • Method Details

    • getTokenId

    • getSecret

      public org.elasticsearch.common.settings.SecureString getSecret()
    • getAccountId

      public ServiceAccount.ServiceAccountId getAccountId()
    • getTokenName

      public String getTokenName()
    • getQualifiedName

      public String getQualifiedName()
    • asBearerString

      public org.elasticsearch.common.settings.SecureString asBearerString() throws IOException
      Throws:
      IOException
    • fromBearerString

      public static ServiceAccountToken fromBearerString(org.elasticsearch.common.settings.SecureString bearerString) throws IOException
      Throws:
      IOException
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • newToken

      public static ServiceAccountToken newToken(ServiceAccount.ServiceAccountId accountId, String tokenName)
    • principal

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

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

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