credentials
credentials
The OLP CLI supports the following:
- list all available credentials
- show a current profile
- import a new profile
- delete an existing profile
- update an existing profile
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
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 theolpcli.inifile.--jsonDisplays the command result in JSON format.--quietDisplays app IDs, each on a new line.
For more information on using credentials and profiles, see Credentials setup.
Example:
olp credentials listOutput:
app ID profile scope source
ylH5uh69n7DedRvGMUmp demo-profile hrn:here:authorization::org:project/project-e2e-lv <user_home>/.here/olpcli.ini
f6AvwZgJBeHM51sosAKQ prod <user_home>/.here/olpcli.ini
F9p0HU3qCqtxnZ3KnH4a staging <user_home>/.here/olpcli.inicredentials show
Shows the information about the application associated with the credentials file.
olp credentials showOptional 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 theolpcli.inifile.--jsonDisplays the command result in JSON format.--quietDisplays app IDs, each on a new line.
For more information on using credentials and profiles, see Credentials setup.
NoteTo use this command, the application associated with the credentials file must have read permission on its own resource — in other words, it must be granted access to itself beforehand. This can be done using the olp app manager add command.
Example:
The command below shows the details of an app:
olp credentials showOutput:
clientId my-app-1234
name my-app-name
description My app description
status active
hrn hrn:here:account::org:app/my-app-1234credentials 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]
NoteIf the default profile is not present in
.here\olpcli.ini, <profile name> will be also added as default profile.
Required parameters:
<profile name>The name of a new profile. Use unique names, otherwise, use the--forceparameter.<path to credentials.properties file>The path to thecredentials.propertiesfile.
Optional parameters:
--forceAllows importing app credentials even if a profile with the specified name exists. As a result, the imported profile replaces the original one.
NoteIf
olpcli.iniis present, thencredentials.propertiesis not used unless specified with the--credentialsparameter. 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.propertiesOutput:
[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-lvTo 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 newProfileOutput:
Profile newProfile has been deletedcredentials 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--forceparameter.--scope <project HRN>The new scope for the profile. To remove the existing scope from the profile, useempty.--forceAllows 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.
NoteFor the
credentials.propertiesfile, you can only update thescopeproperty.
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/myprojectOutput:
Profile new-profile has been updated with new scope hrn:here:authorization::org:project/myprojectExample:
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 emptyOutput:
Profile old-profile has been updated with empty scopeExample:
The command below updates the credentials.properties file with a new scope:
olp credentials update default --scope hrn:here:authorization::org:project/myprojectOutput:
credentials.properties has been updated with new scope hrn:here:authorization::org:project/myprojectUpdated 22 days ago