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)[source]#

Bases: object

This class is responsible for authenticating with the HERE platform.

It requires PlatformCredentials, AAAOauth2BaseApi object.

generate_token()[source]#

Authenticate with the HERE account service and retrieve a new token.

set_scope(project_hrn: str)[source]#

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

token_still_valid() bool[source]#

Check whether the auth token is still valid or expired.

Returns:

a boolean indicating if a token is still valid.