xyzspaces.iml.auth module¶
This module provides an Auth
class to authenticate an app on the platform.
The authentication is based on some credentials object and will create an access token. It can be checked if the token is still valid, and it can be refreshed, too.
- class xyzspaces.iml.auth.Auth(credentials, aaa_oauth2_api)[source]¶
Bases:
object
This class is responsible for authenticating with the HERE platform.
It requires PlatformCredentials, AAAOauth2BaseApi object.
- Parameters
credentials (xyzspaces.iml.credentials.Credentials) –
aaa_oauth2_api (xyzspaces.iml.apis.aaa_oauth2_api.AAAOauth2Api) –
- __init__(credentials, aaa_oauth2_api)[source]¶
Instantiate authentication token.
- Parameters
credentials (xyzspaces.iml.credentials.Credentials) – an instance of PlatformCredentials
aaa_oauth2_api (xyzspaces.iml.apis.aaa_oauth2_api.AAAOauth2Api) – an instance of AAAOauth2Api required in case of Credentials type.
- property token: Optional[str]¶
Return the current token or requests a new one if needed.
- Returns
a valid token