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
__init__(credentials, aaa_oauth2_api)[source]

Instantiate authentication token.

Parameters
property token: Optional[str]

Return the current token or requests a new one if needed.

Returns

a valid token

token_still_valid()[source]

Check whether the auth token is still valid or expired.

Returns

a boolean indicating if a token is still valid.

Return type

bool

generate_token()[source]

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