API Key is a simple Authentication Method supported by the Akeyless Vault Platform. API Keys are very popular primarily for testing or staging environments.

Create an API Key Authentication Method from the CLI

Let's create a new API Key authentication method using the Akeyless CLI. (You can do this also from the Akeyless Console.)

To create an API Key authentication method from the CLI, run the following command:

akeyless create-auth-method -name MyFirstAPIKey

Where:

  • name: A unique name for the authentication method. The name can include the path to the virtual folder where you want to create the new authentication method, using slash / separators. If the folder does not exist, it will be created together with the authentication method.

๐Ÿšง

Note:

Akeyless API Key is displayed only once. Ensure saving it outside the CLI.

Parameters

You could find the complete list of parameters for this command in the CLI Reference - Authentication section.

Configure Akeyless CLI with the API Key authentication method

To configure your CLI to work with API Key authentication, run the following command:

akeyless configure --profile default --access-id <Your API Key Auth AccessID>  --access-key <Your API Key>

Create an API Key authentication method in the Akeyless Console

  1. Log in to the Akeyless Console and go to Auth Methods > New > API Key.

  2. Define a Name for the authentication method, and specify the Location as a path to the virtual folder where you want to create the new authentication method, using slash / separators. If the folder does not exist, it will be created together with the authentication method.

  3. Define the remaining parameters as follows:

    • Expiration Date: Select the access expiration date. This parameter is optional. Leave it empty for access to continue without an expiration date.

    • Allowed Client IPs: Enter a comma-separated list of CIDR blocks from which the client can issue calls to the proxy. By "client," we mean CURL, SDK, etc. This parameter is optional. Leave it empty for unrestricted access.

    • Allowed Trusted Gateway IPs: Enter a comma-separated list of CIDR blocks from which Gateway calls will be accepted. This parameter is optional. Leave it empty for unrestricted access.

  4. Click "Save".

  5. Download a CSV file with the Access ID and Access Key, or send them by email.

492492

๐Ÿ‘

What's next?

Make sure to associate your new Authentication Method with an Access Role to grant the relevant permissions within Akeyless


Did this page help you?