iagctl login

Log in to the gateway server.

The iagctl login command authenticates a user with the gateway server from a client. After you log in, the gateway writes your API key to the api.key file in your gateway working directory. The gateway client automatically reads this file for subsequent API calls.

Always treat passwords and API keys with the utmost caution. Never share them with anyone.

For more information, see Manage users and credentials.

Syntax

$iagctl login <username> [flags]

Usage notes

Initial login

The first time the server starts, it displays a temporary password for the admin user in the logs. When you log in with the admin user for the first time, the gateway requires you to change the password.

After authentication, the gateway server returns an API key with a default expiration time of 24 hours. You can change the expiration timeout on the server using the GATEWAY_SERVER_API_KEY_EXPIRATION configuration variable.

Change a password

Use the --change-password flag to change your password. When you change a password, the gateway removes all previously created API keys for that user.

Recover the admin account

If you lose the admin account credentials, run iagctl server --recover-admin-user on the server to start the reset process.

Examples

Log in

$iagctl login jared
$Enter password for user:
$Successfully logged in!

View the API key

Use the --raw flag to print the full API key to the terminal. This can be useful when using gateway commands in external applications:

$iagctl login jared --raw
$
$Enter password for user:
${
> "api_key": "AaJH5mic-BjShSjgqlSMj05DdJERcrLpudP-yJqEDvgwAOG"
>}

Change a password

$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 Change the password for the user.
$ -h, --help Help for login

Options inherited from parent commands

$ --config string Path to the configuration file
$ --raw Display the result of the command in raw format
$ --verbose Enable verbose output