here.platform.auth module
here.platform.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 here.platform.auth.Auth(credentials: PlatformCredentials, aaa_oauth2_api: AAAOauth2Api | None = None)
Bases: object
This class is responsible for authenticating with the HERE platform.
It requires PlatformCredentials, AAAOauth2BaseApi object.
Authenticate with the HERE account service and retrieve a new token.
Explicitly sets the project scope if not set yet or overwrites the project scope from the configuration.
Parameters:
project_hrn – the project HRN string
property token: str | None
Return the current token or requests a new one if needed.
Returns:
a valid token
Check whether the auth token is still valid or expired.
Returns:
a boolean indicating if a token is still valid.