- 12 Nov 2024
-
DarkLight
-
PDF
login
- Updated on 12 Nov 2024
-
DarkLight
-
PDF
iagctl login
Login methods to use with gateway
Synopsis
Login allows a configured user to login to the gateway server from a client to begin making calls to the system.
⚠ Always treat passwords and API keys with the utmost caution. Never share them with anyone.
Once logged in, the API key will be written to your gateway working directory as the file api.key
. The gateway client will automatically read from this file for subsequent API calls to the gateway server.
Login also provides functionality to change the user password via the --change-password
flag. When a password is changed, all previously created API keys for that user will be removed.
If the credentials to the admin account are lost, a user on the server can run iagctl server --recover-admin-user
to begin the reset process.
Initial Login
The first time the server is started up there will be a temporary password for the admin
user displayed in the logs.
Once you log in with the admin
user for the first time, you will be required to change your password.
Once authenticated, the gateway server will return API keys with a default expiration time of 24 hours.
The API keys expiration timeout can be changed on the server using the configuration variable GATEWAY_SERVER_API_KEY_EXPIRATION
.
iagctl login <username> [flags]
Examples
Login from CLI
iagctl login jared
Enter password for user:
Successfully logged in!
View the API Key
If you would like to see the entire API key printed to the terminal, use the --raw
flag.
Outputting the key can be useful when leveraging gateway commands in external applications.
iagctl login jared --raw
Enter password for user:
{
"api_key": "AaJH5mic-BjShSjgqlSMj05DdJERcrLpudP-yJqEDvgwAOG"
}
Changing Password
When changing a password, the client will login the user, set the new API key, and invalidate all active API keys for that user.
iagctl login jared --change-password
Enter password for user:
Enter your NEW password to login:
Re-enter your NEW password for verification:
Password verified successfully!
Password was successfully reset!
Please login with the new password you just set.
Enter the NEW password for user:
Successfully logged in!
Options
--change-password Changes password for the user.
-h, --help Help for login
Options Inherited from Parent Commands
--config string Path to the configuration file
--raw Displays the result of the command in its raw format
--verbose Enable verbose output
CLI References
For all CLI commands see → Command References Index