Class BsaCredential

java.lang.Object
google.registry.bsa.api.BsaCredential

@ThreadSafe public class BsaCredential extends Object
A credential for accessing the BSA API.

Fetches on-demand an auth token from BSA's auth http endpoint and caches it for repeated use until the token expires (expiry set by BSA and recorded in the configuration file). An expired token is refreshed only when requested. Token refreshing is blocking but thread-safe.

The token-fetching request authenticates itself with an API key, which is stored in the Secret Manager.

  • Field Details

    • ID_TOKEN

      public static final String ID_TOKEN
      The variable name for the auth token in the returned json response.
      See Also:
  • Method Details

    • getAuthToken

      public String getAuthToken()
      Returns the auth token for accessing the BSA API.

      This method refreshes the token if it is expired, and is thread-safe..