API Keys

The "API Keys" module allows you to manage the BPC’s API keys. An API key enables systems and scripts to access the BPC REST API without requiring a user to log in. Each API key is a separate component of the module and contains assignments to organizations, roles, and permissions, as well as a validity period.

How an API key is used when calling the API is described in Using API Keys.

Interface

API keys are managed in the administration area under the API Keys tab. The component overview on the left lists all created API keys; the settings for the selected API key are displayed on the right.

Component overview of the API Keys module with a saved API key

Use the plus icon (marked in red, bottom left) to create a new API key. The key of a saved API key is now displayed only as a masked string ().

Prerequisites

To manage API keys, the following prerequisites must be met:

Create an API Key

This section describes how to create a new API key. The key and ID are automatically generated by BPC.

  1. In the administration area, navigate to the API Keys tab.

  2. Click the plus icon to add a new component.

    The "Editor" window opens with a newly generated API key.

  3. Under "Name," enter a name that describes the intended use.

  4. Copy the API key using the copy icon on the right side of the API Key field.

    New API key with copy icon and note
  5. Store the API key in a secure location, such as a password manager.

  6. Under "Issuance Details," check the "Issued On " and "Valid Until" fields.

    Both fields are pre-filled: The API key is valid immediately and for one year.

    Pre-filled Issuance Details for a New API Key
  7. Under "Assignments," define the organizations, roles, and permissions for the API key.

  8. Click " Save."

The API key has been created and appears in the component overview.

Once saved, the API key can no longer be viewed or copied. If you have not saved the key, create a new API key and delete the old one.

Copy API Key

To create an API key with the same mappings for another system, you can copy an existing API key. The copy will be assigned a new key, a new ID, and a new validity period.

  1. In the component overview, click the copy icon next to the desired API key.

    The "Editor" window opens with the settings of the copied API key and a newly generated key.

  2. Copy the new API key and store it in a secure location.

  3. Click Save.

The new API key has been created and appears in the component overview.

Delete API Key

A deleted API key becomes invalid immediately. Any systems using this API key will no longer be able to access the BPC REST API.

  1. In the component overview, click the delete icon () next to the desired API key.

  2. Confirm the deletion.

The API key has been deleted.

Configuration Parameters

The following configuration parameters apply to the entire module.

Basic Settings

General module settings

Name (ID) Description

Module Without GUI
(noGui)

Indicator for the front end that there is no user interface for loading this module. Should not be changed.

Icon
(module_iconCls)

Individually selectable icon that is displayed before the title.
If no icon is to be displayed, e.g. "none" can be entered. If the field is empty, a standard icon is selected.

Configuration

Name (ID) Description

API Key Notifications
(apiKeysNotifications)

Notifications for expiring API keys. This configuration can be used to control when notifications are sent for expiring API keys.

In addition, the following settings are configured for each API key:

Basic Settings

General module settings

Name (ID) Description

Icon
(module_iconCls)

Individually selectable icon that is displayed before the title.
If no icon is to be displayed, e.g. "none" can be entered. If the field is empty, a standard icon is selected.

API Key
(apiKey)

An API key is used for authentication and authorization with the BPC REST API. It can no longer be viewed after saving.

Issue Details

The issue details of the API key.

Name (ID) Description

Issued by
(issuedBy)

The user who issued the API key.

Issued for
(issuedFor)

The user for whom the API key was issued.

Issued on
(issuedOn)

The date the API key was issued.

Valid until
(expiresOn)

The date the API key is valid until.

Assignments

Organizations, roles, and rights assigned to the API key.

Name (ID) Description

Organizations
(assignedOrganisations)

Organizations assigned to the API key.

Roles
(assignedRoles)

Roles assigned to the API key.

Rights
(assignedRights)

Rights assigned to the API key.

Once the date specified under “Valid Until” has passed, the API key immediately becomes invalid. This will cause calls to API endpoints and deployment processes to fail until a new key is provided or the expiration date is updated.

Mappings

Using the mappings assignedOrganisations, assignedRoles, and assignedRights, fine-grained access rights can be assigned to API keys.

For example, according to the API documentation, either the role BACKUPS_ADMIN or the permission BACKUPS_CREATE is required to call this backup API endpoint. If you want the API key user to be able to call only this single API endpoint, set only the permission BACKUPS_CREATE at assignedRights. If, instead, all backup endpoints should be accessible, set the role “ BACKUPS_ADMIN ” at assignedRoles.

Migration from the Core setting “API_Keys”

Up to configuration model version 36, all API keys were stored together in the Core setting “ API_Keys ”. When updating to version 37, each entry in this setting is automatically transferred to its own component in the "API Keys" module. The name is taken from name, and the description of the component is taken from description. The setting apiKeysNotifications is moved to the "API Keys" module without any changes.


Keywords: