Get your credentials
Get your credentials
All users of the HERE platform must obtain authentication and authorization credentials.
The following approaches are available for authenticating your application with the HERE platform:
- using the platform credentials available from the platform portal in combination with the Data Client Library credential management system (recommended for development)
- using encrypted platform credentials and programmatically providing these credentials to the Data Client Library credential management system
- using the access key ID and access key secret in the platform credentials to create your own authentication and authorization client for retrieving HERE tokens, which you can then provide to the Data Client Library credential management system. For more information, see the Identity & Access Management Guide.
To obtain your platform credentials, create a new application via the HERE platform portal page. When you have created your application, click Create A Key to download these credentials.
If you are using option one above, place the credentials in
$HOME/.here/credentials.properties.
NoteDownloading the Data Processing Library
To download the Data Processing Library, you need repository credentials. To obtain your credentials, go to https://platform.here.com/profile/repository and click Generate Credentials, to download thesettings.xmlfile.
Credential options
The snippets below demonstrate different ways of supplying your platform credentials to the Data Client Library.
When you initialize a new service client without supplying any credentials as
arguments, the Data Client Library attempts to find your platform credentials using
the default credential provider chain: a platform credentials file in the JVM
classpath, the default location platform credentials download location
(~/.here/credentials.properties) and the Java system properties in that
order.
NoteBilling tags
The snippets below also demonstrate the use of HERE platform billing tags, which you can use in requests to the platform in order to later associate your requests with the invoicing for those requests.
Set your credentials via the application's configuration file
Based on the values in the platform credentials, include the following
parameters in your application.conf file:
here.platform.data-client.request-signer {
billing-tag = "example_billing_tag"
credentials {
here-account {
here-token-endpoint-url = "https://account.api.here.com/oauth2/token"
here-client-id = "example-client-id"
here-access-key-id = "example-access-key-id"
here-access-key-secret = "example-access-key-secret"
}
}
}here.platform.data-client.request-signer {
billing-tag = "example_billing_tag"
credentials {
here-token = "example-token"
}
}Set your credentials in the credentials file
The Data Client Library can read the HERE access key and access secret data
from the credentials.properties file.
- The client looks for a
credentials.propertiesfile in the Java Virtual Machine (JVM) classpath. - A fallback location to find platform credentials is in
~/.here/credentials.properties - Alternatively, you can specify an alternate credentials file location in the
application.conffile.
here.platform.data-client.request-signer {
billing-tag = "example_billing_tag"
credentials {
file-path = "/path/credentials.properties"
}
}Example of credentials properties file:
here.user.id = example-here-user-id
here.client.id=example-client-id
here.access.key.id=example-access-key-id
here.access.key.secret=example-access-key-secret
here.token.endpoint.url="https://account.api.here.com/oauth2/token"
NoteUsing previously generated tokens
Previously generated HERE tokens are not supported for the platform credentials file format.
Set your credentials via Java system properties
To set your credentials via Java System Properties, define the following:
-Dhere.platform.data-client.request-signer.credentials.here-account.here-token-endpoint-url="https://account.api.here.com/oauth2/token"
-Dhere.platform.data-client.request-signer.credentials.here-account.here-client-id="example-client-id"
-Dhere.platform.data-client.request-signer.credentials.here-account.here-access-key-id="example-access-key-id"
-Dhere.platform.data-client.request-signer.credentials.here-account.here-access-key-secret="example-access-key-secret"-Dhere.platform.data-client.request-signer.credentials.here-token="example-token"Updated 22 days ago