Credentials Setup

This chapter helps you to:

  • Get your credentials
  • Pass credentials to the {book.productName}}

Get Your Credentials

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

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

Pass Credentials to the {book.productName}}

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

  • Default credentials
  • Credentials file
  • Environment variables

For the next sections we assume that you obtained your credentials as described in section "Get Your Credentials".

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>

Default Credentials

  1. Precondition is that you downloaded the generated credentials.properties file from the HERE Platform
  2. Place the credentials file at:

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

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

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
HERE_TOKEN_SCOPE

Note 1

The environment variables HERE_TOKEN_ENDPOINT_URL and HERE_TOKEN_SCOPE are 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 ""