Managing Credentials
When user authentication is enabled, the TigerGraph system will execute a requested operation only if the requester provides credentials for a user who has the privilege to perform the requested operation.
The TigerGraph system offers two options for credentials.
  • Username and password pair.
  • API token: A unique 32-character string that can be used for REST++ requests. A token expires 1 month from the date of creation by default. Users can use their secrets or their username and password pair to generate a token.
The following set of commands are used to create and manage passwords and secrets.
GSQL Commands for Managing Credentials
1
ALTER PASSWORD [user1]
2
CREATE SECRET [alias1]
3
SHOW SECRET
4
DROP SECRET <secret1>
Copied!
Like any other GSQL commands, the user must supply credentials to run these commands. In order to create a secret, the user must supply their password.

Passwords

Users can change their own passwords with the ALTER PASSWORD command. If the user has the WRITE_USER privilege, they can change the password of another user.
1
ALTER PASSWORD [<user1>]
Copied!
If a username is not provided, the command changes the password of the current user. To change the password of another user, specify the username of the user whose password you wish to change:
Example: User changing his/her own password
1
herminone:GSQL > ALTER PASSWORD
2
Password: *******
3
New Password : ************
4
Re-enter Password : ************
5
Password has been changed.
Copied!
Example: Admin changing another user's password
1
tigergraph:GSQL > ALTER PASSWORD hermione
2
Password: *******
3
New Password : ************
4
Re-enter Password : ************
5
Password has been changed.
Copied!

Secrets

Secrets are unique strings that serve as a user's credentials in certain circumstances. A user can have multiple secret strings. Each secret is associated with one user and their role for one graph. If the role is revoked, the secret also becomes invalid.

Create a secret

1
CREATE SECRET [<alias>]
Copied!
Use the CREATE SECRET command to generate a secret for the current user and graph. It is optional to provide an alias for the secret.
Beginning with TigerGraph 3.1.4, the system will generate a random alias for the secret if the user does not provide an alias for that secret. Randomly generated aliases begin with AUTO_GENERATED_ALIAS_ and include a random 7-character string.

List secrets

1
SHOW SECRET
Copied!
Use SHOW SECRET to list all secrets of the current user. The secrets will be masked and only the first and last three characters of the secrets will be shown. The alias of the secret and the graph that the secret is associated with will also be listed:
1
GSQL > SHOW SECRET
2
- Secret: s7s****3k5
3
- Alias: HH
4
- GraphName: Hogwarts
5
- Secret: 75j****9i2
6
- Alias: LL
7
- GraphName: London
Copied!

Drop a secret

1
DROP SECRET <secret>
Copied!
Use the DROP SECRET command to drop a secret. Since a user can have multiple secrets, the secret to drop must be specified in the command. You can specify a secret either by the secret string itself or by its alias.
Last modified 2mo ago
Export as PDF
Copy link