HashiCorp Cloud Platform
Service principal keys
This page describes the steps to generate and delete service principal keys using the HCP UI, HCP CLI, or HCP Terraform provider. On HCP, service principals are attached to authentication keys that include a pair value of the Client ID and the Client secret. The external client uses the key to authenticate with the HCP public API.
The maximum allowed keys for a single service principal is two.
Generate a service principal key
You can generate organization-level and project-level service principal keys. The service principal key should exist at the same level of the service principal it attaches to.
Organization-level keys
- Log into the HCP portal and choose your organization.
- Click Access control (IAM).
- Click Service principals.
- Click the specific service principal to open the detailed view screen.
- Click Keys.
- Click Generate key.
- Copy the Client secret and save it to a secure location for later use.
Project-level keys
- Log into the HCP portal and choose your organization.
- Click Projects and select the desired project to create a service principal in.
- Click Access control (IAM).
- Click Service principals.
- Click the specific service principal to open the detailed view screen.
- Click Keys.
- Click Generate key.
- Copy the Client secret and save it to a secure location for later use.
Delete a service principal key
Follow similar steps to delete organization-level and project-level service principal keys.
Organization-level keys
- Log into the HCP portal and choose your organization.
- Click Access control (IAM).
- Click Service principals.
- Click the specific service principal to open the detailed view screen.
- Click Keys.
- Click on the dropdown next to the specific key you want to delete.
- Click Delete key.
- Type
DELETE
in the prompted field and click Delete.
Project-level service principals
- Log into the HCP portal and choose your organization.
- Click Projects and select the desired project to create a service principal in.
- Click Access control (IAM).
- Click Service principals.
- Click the specific service principal to open the detailed view screen.
- Click Keys.
- Click on the dropdown next to the specific key you want to delete.
- Click Delete key.
- Type
DELETE
in the prompted field and click Delete.