credentials
The OLP CLI supports the following:
credentials list
Retrieves all the available credentials. The OLP CLI resolves the credentials list in the same order as it resolves the credentials being passed. For more more information, see Passing credentials to CLI. For the credentials.properties
file, the command always returns the default
profile only.
olp credentials list [command options]
Optional parameters:
-
--credentials <path to credentials file>
The name of a credentials file to use with the command. Credentials files are downloaded separately from the platform portal. -
--profile <profile name>
The name of the credentials profile to use from the olpcli.ini
file. -
--json
Displays the command result in JSON format. -
--quiet
Displays app IDs, each on a new line.
For more information on using credentials and profiles, see Credentials setup.
Example:
olp credentials list
Output:
app ID profile scope source
ylH5uh69n7DedRvGMUmp demo-profile hrn:here:authorization::org:project/project-e2e-lv /.here/olpcli.ini
f6AvwZgJBeHM51sosAKQ prod /.here/olpcli.ini
F9p0HU3qCqtxnZ3KnH4a staging /.here/olpcli.ini
credentials import
Imports the credentials from the specified credentials.properties
file to the .here\olpcli.ini
file:
olp credentials import <profile name> <path to credentials.properties file> [command parameters]
Note
If the default profile is not present in .here\olpcli.ini
, will be also added as default profile.
Required parameters:
-
<profile name>
The name of a new profile. Use unique names, otherwise, use the --force
parameter. -
<path to credentials.properties file>
The path to the credentials.properties
file.
Optional parameters:
-
--force
Allows importing app credentials even if a profile with the specified name exists. As a result, the imported profile replaces the original one.
Note
If olpcli.ini
is present, then credentials.properties
is not used unless specified with the --credentials
parameter. For more information, see Passing credentials to CLI.
Example:
The command below creates an .here\olpcli.ini
file in your home directory and associates the credentials from the credentials.properties
file with the newProfile
profile:
olp credentials import newProfile credentials.properties
Output:
[profile newProfile]
here.user.id = HERE-01966c94-aaf1-4ae2-a1y6-6516b3f9b6c1
here.client.id = mzLcb1rL8nskvDQpCAAO
here.access.key.id = BELUTk45QdaYGgZ9A_IMTA
here.access.key.secret = 108lI7w9m8G_6sIw9kng-PXGoeHQQ-cv6xByNOuMcRYixZZp...
here.token.endpoint.url = https://account.api.here.com/oauth2/token
here.token.scope = hrn:here:authorization::org:project/project-e2e-lv
To use this new profile, add --profile newProfile
to CLI commands or set the OLP_PROFILE
environment variable to newProfile
.
credentials delete
Deletes the specified profile from the .here\olpcli.ini
file.
olp credentials delete <profile name> [command paramenters]
Required parameters:
-
<profile name>
The name of the profile to remove.
Example:
The command below removes the newProfile
profile from the olpcli.ini
file:
olp credentials delete newProfile
Output:
Profile newProfile has been deleted
credentials update
Updates the scope of the credentials.properties
file or a profile in the .here\olpcli.ini
file.
olp credentials update <profile name> [command paramenters]
Required parameters:
-
<profile name>
The name of the profile you want to update.
Optional parameters:
-
--name <profile name>
The new name for the profile. Use unique names, otherwise, use the --force
parameter. -
--scope <project HRN>
The new scope for the profile. To remove the existing scope from the profile, use empty
. -
--force
Allows updating the profile name using the name of an existing profile, which will be deleted as a result. -
--credentials <path to credentials file>
The path to a credentials file to be updated.
Note
For the credentials.properties
file, you can only update the scope
property.
Example:
The command below updates the old-profile
profile in the olpcli.ini
file with a new name and scope:
olp credentials update old-profile --name new-profile --scope hrn:here:authorization::org:project/myproject
Output:
Profile new-profile has been updated with new scope hrn:here:authorization::org:project/myproject
Example:
The command below updates the old-profile
profile in the olpcli.ini
file by removing the project scope from the mentioned profile:
olp credentials update old-profile --scope empty
Output:
Profile old-profile has been updated with empty scope
Example:
The command below updates the credentials.properties
file with a new scope:
olp credentials update default --scope hrn:here:authorization::org:project/myproject
Output:
credentials.properties has been updated with new scope hrn:here:authorization::org:project/myproject