Credentials Setup

All users of the HERE Platform must obtain authentication and authorization credentials.

For the available authentication options, see the Identity & Access Management Developer Guide.

The HERE Data SDK for Python supports the following methods to provide your credentials:

  • Default credentials
  • Credentials file
  • Environment variables

Default Credentials

  1. Go to HERE Platform Applications and Keys and register a new app.
  2. Create a key for the app and download the generated credentials.properties file.
  3. Place the credentials file into:

    For Linux/MacOS: $HOME/.here/credentials.properties

    For Windows: %USERPROFILE%\.here\credentials.properties

The HERE platform generated app credentials should look similar to the example below:

here.user.id = <example_here>
here.client.id = <example_here>
here.access.key.id = <example_here>
here.access.key.secret = <example_here>
here.token.endpoint.url = <example_here>

Note

If you want to access catalogs or other resources with a dedicated project scope you need to add a line like this to the credentials.properties file:

here.token.scope = <project_hrn>

Credentials File

You can specify any credentials file as an alternative to the one in the default location. An error is raised if the specified file is not present, or if the file is not formatted properly.

Code Snippet:

platform_cred = PlatformCredentials.from_credentials_file("<Path_to_file>")
platform_obj = Platform(platform_cred)

Environment Variables

You can override the default credentials by assigning values to the following environment variables:

HERE_USER_ID
HERE_CLIENT_ID
HERE_ACCESS_KEY_ID
HERE_ACCESS_KEY_SECRET
HERE_TOKEN_ENDPOINT_URL

Note 1

The environment variable HERE_TOKEN_ENDPOINT_URL is optional.

Note 2

If you want to access catalogs or other resources with a dedicated project scope you can define that scope by setting following environment variable:

HERE_TOKEN_SCOPE=<project_hrn>

Code snippet:

platform_cred = PlatformCredentials.from_env()

results matching ""

    No results matching ""