Authorization
The ClientCredentialsAuth class
- class firecrest.ClientCredentialsAuth(client_id: str, client_secret: str, token_uri: str, min_token_validity: int = 10)
Bases:
objectClient Credentials Authorization class.
- Parameters:
client_id (string) – name of the client as registered in the authorization server
client_secret (string) – secret associated to the client
token_uri (string) – URI of the token request in the authorization server (e.g. https://auth.your-server.com/auth/realms/cscs/protocol/openid-connect/token)
min_token_validity (float) – reuse OIDC token until {min_token_validity} sec before the expiration time (by default 10). Since the token will be checked by different microservices, setting more time in min_token_validity will ensure that the token doesn’t expire in the middle of the request.
- timeout: float | Tuple[float, float] | Tuple[float, None] | None
It will be passed to all the requests that will be made. How many seconds to wait for the server to send data before giving up. After that time a requests.exceptions.Timeout error will be raised.
It can be a float or a tuple. More details here: https://requests.readthedocs.io.
- disable_client_logging: bool
Disable all logging from this authorization object.
- get_access_token() → str
Returns an access token to be used for accessing resources. If the request fails the token will be None