For AI agents: the complete documentation index is available at https://docs.ovhcloud.com/en/llms.txt, the full documentation bundle is available at https://docs.ovhcloud.com/en/llms-full.txt, and this page is available as Markdown at https://docs.ovhcloud.com/en/guides/manage-and-operate/kms/okms-authentication-methods.md.

OKMS authentication methods

View as Markdown

Find out how to configure Personal Access Tokens, service accounts, or access certificates to authenticate to your OKMS domain regional REST API

Objective

This guide explains how to authenticate to the OKMS data plane — the regional REST API exposed on your OKMS domain (for example https://eu-west-rbx.okms.ovh.net). This API is shared by Key Management Service (KMS) and Secret Manager.

Three authentication methods are available for the REST API. KMIP integrations support access certificates only — we recommend reserving certificates for KMIP use cases, as they require a more complex setup than tokens.

Requirements

Instructions

Understand the OKMS data plane

The OKMS data plane is the regional API endpoint for cryptographic operations (KMS) and secret storage (Secret Manager). It is distinct from the centralized OVHcloud API control plane (/v2/okms/...), which manages OKMS domain provisioning and configuration.

LayerEndpoint examplePurpose
Data plane (regional)https://eu-west-rbx.okms.ovh.netEncrypt, sign, manage keys and secrets on the domain
Control plane (OVHcloud API)Order domains, manage credentials, configure logging

You can interact with the data plane through the unified Swagger UI at https://<region>.okms.ovh.net/swagger/, the OKMS CLI, or the Go SDK.

Info

Your okmsId and your regional endpoint are both returned by the following API call:

GET/okms/resource

Both are also displayed in the General information tab of your .

Choose your authentication method

MethodBest forREST APIKMIP
Personal Access Token (PAT)Scripts and automation acting on behalf of a local userSupportedNot supported
Service accountMachine-to-machine integrationsSupportedNot supported
Access certificateKMIP-compatible products, mTLS clients, browser-based Swagger with client certificatesSupportedRequired
Tip

For REST API access, prefer a PAT or service account. Reserve access certificates for KMIP or mTLS-based clients.

Set up authentication

Personal Access Token
Service account
Access certificate

Step 1 — Create a local user

If you do not have one yet, create an OVHcloud local user.

Step 2 — Create a PAT

Create a Personal Access Token (PAT) on the local user.

Step 3 — Create an IAM policy

Create an IAM policy that grants the local user the required OKMS actions on your domain. See IAM rights for OKMS below.

Use the PAT on the data plane

Send the PAT as a Bearer token:

curl -H "Authorization: Bearer <your_pat>" \
  https://eu-west-rbx.okms.ovh.net/api/<okmsId>/v1/servicekey

In the Swagger UI, use the personalAccessToken scheme in the Authorize dialog.

If the regional endpoint does not accept the Bearer scheme directly, use hybrid authentication with the pat_jwt_ prefix as described in the PAT guide.

Use the OKMS Swagger UI

The OKMS domain exposes a unified Swagger UI at https://<region>.okms.ovh.net/swagger/. For example, for a domain in eu-west-rbx: https://eu-west-rbx.okms.ovh.net/swagger/.

You can also open it from the Swagger link on your .

The Swagger UI supports all three REST API authentication methods. Complete the setup steps for your chosen method, including the required IAM policy, before executing requests.

Personal Access Token

  1. Click the Authorize button (lock icon) in the Swagger UI.
  2. Under personalAccessToken (HTTP Bearer, JWT format), paste the PAT you created for your local user.
  3. Click Authorize, then Close.

Swagger sends your token as an Authorization: Bearer <token> header on every request you execute.

Service account

  1. Click the Authorize button in the Swagger UI.
  2. Under oAuth2ClientCredentials, enter your service account client_id and client_secret. See How to use service accounts to connect to OVHcloud APIs to obtain these credentials.
  3. Swagger obtains an OAuth2 access token using the client-credentials flow and attaches it to subsequent requests.

Access certificate

Access certificate authentication uses mutual TLS (mTLS) at the transport layer. The certificate is presented by your browser when connecting to the Swagger URL — it is not configured through the Authorize dialog.

Import your certificate into the browser

Convert your OKMS certificate and private key to PKCS#12 format (assuming files named ID_certificate.pem and ID_privatekey.pem):

openssl pkcs12 -export -in ID_certificate.pem -inkey ID_privatekey.pem -out client.p12

You will be prompted to set a password for the encrypted file. Import client.p12 into your browser:

On Firefox

  • Type about:preferences#privacy into the address bar.
  • Scroll down to the Certificates section.
Firefox certificate manager settings
  • Click View Certificates..., open the My Certificates tab, then Import... and select your client.p12 file.
  • Enter the PKCS#12 password when prompted.

On Chrome/Chromium

  • Type chrome://settings/certificates into the address bar.
  • Open the Your certificates tab, click Import, and select your client.p12 file.
  • Enter the PKCS#12 password when prompted.
Chromium certificate manager
Access Swagger with your certificate

Open https://<region>.okms.ovh.net/swagger/ in your browser. You will be prompted to select the imported certificate:

Browser certificate identification prompt

You can now execute API calls interactively from the Swagger UI.

IAM rights for OKMS

OKMS IAM actions follow the pattern okms:<channel>:<resource>/<operation>:

ChannelScopeUsed for
okms:apiovhOKMS domain management OKMS domain and certificates configuration, keys and secrets management
okms:apikmsRegional data plane REST APIDirect regional API calls
okms:kmipKMIP protocolKMIP-compatible product integrations — see dedicated documentation

Domain management actions on OVHcloud API v2

Browse the full action list in the under product type Key Management System (KMS), or in IAM policies when creating a policy.

ActionDescription
okms:apiovh:resource/getList OKMS services on the account
okms:apiovh:resource/updateUpdate an OKMS service
okms:apiovh:serviceKey/getList or retrieve encryption keys
okms:apiovh:serviceKey/createCreate or import a key
okms:apiovh:serviceKey/importImport a key
okms:apiovh:serviceKey/updateUpdate key metadata (also required to activate or deactivate a key)
okms:apiovh:serviceKey/deleteDelete a key
okms:apiovh:serviceKey/activateActivate a key
okms:apiovh:serviceKey/deactivateDeactivate a key
okms:apiovh:secret/getList secrets and metadata
okms:apiovh:secret/createCreate a secret
okms:apiovh:secret/editRequired to update a secret's data or metadata
okms:apiovh:secret/updateMetadataUpdate secret metadata
okms:apiovh:secret/deleteDelete a secret
okms:apiovh:secret/version/getDataRead secret version content
okms:apiovh:secret/version/editRequired to delete, deactivate, or activate a secret version
okms:apiovh:secret/version/createAppend a new version of the secret data
okms:apiovh:secret/version/deleteDelete a secret version
okms:apiovh:secret/version/activateActivate a secret version
okms:apiovh:secret/version/deactivateDeactivate a secret version
okms:apiovh:credential/getList access certificates
okms:apiovh:credential/createCreate an access certificate
okms:apiovh:credential/deleteDelete an access certificate
okms:apiovh:secretConfig/getRead Secret Manager default configuration
okms:apiovh:secretConfig/updateUpdate Secret Manager default configuration

Actions for the KMS regional API

Browse the full action list in the regional Swagger UI at https://<region>.okms.ovh.net/swagger/ or in IAM policies when creating a policy.

ActionDescription
okms:apikms:serviceKey/getList or retrieve encryption keys
okms:apikms:serviceKey/createCreate a key
okms:apikms:serviceKey/importImport a key
okms:apikms:serviceKey/unwrapKeyUse the key as a transport key to import a wrapped key
okms:apikms:serviceKey/wrapKeyUse the key as a transport key to export a wrapped key
okms:apikms:serviceKey/updateUpdate key metadata
okms:apikms:serviceKey/deleteDelete a key
okms:apikms:serviceKey/activateActivate a key
okms:apikms:serviceKey/deactivateDeactivate a key
okms:apikms:serviceKey/encryptEncrypt data with a key
okms:apikms:serviceKey/decryptDecrypt data with a key
okms:apikms:serviceKey/signSign data with a key
okms:apikms:serviceKey/verifyVerify a signature
okms:apikms:serviceKey/dataKey/createGenerate a data key
okms:apikms:serviceKey/dataKey/decryptDecrypt a data key
okms:apikms:secret/getList secrets and metadata
okms:apikms:secret/createCreate a secret
okms:apikms:secret/updateMetadataUpdate secret metadata
okms:apikms:secret/deleteDelete a secret
okms:apikms:secret/version/getDataRead secret version content
okms:apikms:secret/version/createAppend a new version of the secret data
okms:apikms:secret/version/deleteDelete a secret version
okms:apikms:secret/version/activateActivate a secret version
okms:apikms:secret/version/deactivateDeactivate a secret version
okms:apikms:secretConfig/getRead Secret Manager default configuration
okms:apikms:secretConfig/updateUpdate Secret Manager default configuration
Info

Listing a secret version (okms:apikms:secret/get) is separate from reading its content (okms:apikms:secret/version/getData). Grant both when the identity must read secret values.

Info

Importing a wrapped key needs both the permission to import a key on the OKMS domain (okms:apikms:serviceKey/import) and the permission to unwrap on the transport key (okms:apikms:serviceKey/unwrapKey).

Example IAM policies

Apply these templates to your OKMS domain resource. Its URN is displayed in the General information tab of your . Replace <identity_urn> and <okms_urn> with your values. Create policies via the Control Panel or the IAM API.

Full admin — full control over the OKMS domain via REST API:

{
  "name": "okms-full-admin",
  "description": "Full administrative access to an OKMS domain",
  "identities": ["<identity_urn>"],
  "resources": [{ "urn": "<okms_urn>" }],
  "action": ["okms:apiovh:*", "okms:apikms:*"]
}

Read-only — list and inspect resources without write or cryptographic operations:

{
  "name": "okms-read-only",
  "description": "Read-only access to an OKMS domain",
  "identities": ["<identity_urn>"],
  "resources": [{ "urn": "<okms_urn>" }],
  "action": [
    "okms:apiovh:serviceKey/get",
    "okms:apiovh:secret/get",
    "okms:apiovh:credential/get",
    "okms:apiovh:secretConfig/get",
    "okms:apikms:serviceKey/get",
    "okms:apikms:secret/get",
    "okms:apikms:secretConfig/get"
  ]
}

Add okms:apiovh:secret/version/getData (OVHcloud API v2) or okms:apikms:secret/version/getData (KMS regional API) if the identity must be able to read secret values.

Cryptographic operations only — use keys for encrypt, decrypt, sign, and verify without managing keys or secrets:

{
  "name": "okms-crypto-only",
  "description": "Cryptographic operations on an OKMS domain",
  "identities": ["<identity_urn>"],
  "resources": [{ "urn": "<okms_urn>" }],
  "action": [
    "okms:apikms:serviceKey/get",
    "okms:apikms:serviceKey/encrypt",
    "okms:apikms:serviceKey/decrypt",
    "okms:apikms:serviceKey/sign",
    "okms:apikms:serviceKey/verify",
    "okms:apikms:serviceKey/dataKey/create",
    "okms:apikms:serviceKey/dataKey/decrypt"
  ]
}

Secret access only — read Secret Manager secrets without access to KMS keys, certificates, or domain configuration:

{
  "name": "okms-secret-access-only",
  "description": "Read-only access to Secret Manager secrets on an OKMS domain",
  "identities": ["<identity_urn>"],
  "resources": [{ "urn": "<okms_urn>" }],
  "action": [
    "okms:apiovh:secret/get",
    "okms:apiovh:secret/version/getData",
    "okms:apikms:secret/get",
    "okms:apikms:secret/version/getData"
  ]
}

To manage secrets via the , add okms:apiovh:secret/create, okms:apiovh:secret/edit, okms:apiovh:secret/updateMetadata, and okms:apiovh:secret/delete. To manage them via the KMS regional API, add okms:apikms:secret/create, okms:apikms:secret/updateMetadata, and okms:apikms:secret/delete.

Warning

KMIP operations use okms:kmip:* actions, not okms:apiovh:* or okms:apikms:*. Certificate-based KMIP access requires both certificate creation and the KMIP IAM rights from the KMIP guide.

Go further

Using the OVHcloud Key Management Service (KMS) with your data

Use Secret Manager with REST API

How to connect a compatible product using KMIP protocol

Manage your OKMS access certificate

Join our community of users.

Was this page helpful?