Service Account¶
Authenticates the API using Service Account credentials. Details about the authentication flow implementation can be found in our OAuth2 Example.
Method¶
- disruptive.Auth.service_account(key_id, secret, email)¶
This method uses an OAuth2 authentication flow. With the provided credentials, a JWT is created and exchanged for an access token.
- Parameters:
key_id (str) – Unique Service Account key ID.
secret (str) – Service Account secret.
email (str) – Unique Service Account email address.
- Returns:
auth – Object to initialize and maintain authentication to the REST API.
- Return type:
Examples
>>> # Authenticate using Service Account credentials. >>> dt.default_auth = dt.Auth.service_account( ... key_id="<SERVICE_ACCOUNT_KEY_ID>", ... secret="<SERVICE_ACCOUNT_KEY_ID>", ... email="<SERVICE_ACCOUNT_KEY_ID>", ... )
Class¶
- class disruptive.authentication.ServiceAccountAuth(key_id, secret, email)¶
Ensures that the access token is available and up-to-date.
- Variables:
token_endpoint (str) – URL to which the jwt is exchanged for an access token.