Class AuthToken

java.lang.Object
com.snowflake.ingest.streaming.AuthToken

public final class AuthToken extends Object
An authentication token and, optionally, when it expires. Immutable.
  • Constructor Details

    • AuthToken

      public AuthToken(String authToken)
      A token with no expiry, refreshed only after Snowflake rejects it with a 401 or 403.
      Parameters:
      authToken - the token, non-null and not blank
    • AuthToken

      public AuthToken(String authToken, long expiresAtEpochMillis)
      Parameters:
      authToken - the token, non-null and not blank
      expiresAtEpochMillis - when the token expires, in epoch milliseconds on this host's clock. A time at or before now fails the refresh.
  • Method Details

    • withSpcsServiceToken

      public AuthToken withSpcsServiceToken(String spcsServiceToken)
      Returns a copy of this token that also carries an SPCS service token, for a client running in Snowpark Container Services.
      Parameters:
      spcsServiceToken - the SPCS service token, or null for none
      Returns:
      the copy
    • getAuthToken

      public String getAuthToken()
    • getExpiresAtEpochMillis

      public Long getExpiresAtEpochMillis()
      Returns:
      when the token expires, in epoch milliseconds, or null if it has no expiry
    • getSpcsServiceToken

      public String getSpcsServiceToken()
      Returns:
      the SPCS service token, or null if there is none