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)https://eu.api.ovh.com/v2/okms/...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.

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/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:apiovhControl plane and data plane REST APIKMS keys, secrets, certificates, domain configuration
okms:apikmsRegional data plane REST APIDirect regional API calls (some integrations use both apiovh and apikms actions)
okms:kmipKMIP protocolKMIP-compatible product integrations — see dedicated documentation

Common okms:apiovh actions

ActionDescription
okms:apiovh:serviceKey/getList or retrieve encryption keys
okms:apiovh:serviceKey/createCreate or import a key
okms:apiovh:serviceKey/updateUpdate key metadata
okms:apiovh:serviceKey/deleteDelete a key
okms:apiovh:serviceKey/activateActivate a key
okms:apiovh:serviceKey/deactivateDeactivate a key
okms:apiovh:serviceKey/encryptEncrypt data with a key
okms:apiovh:serviceKey/decryptDecrypt data with a key
okms:apiovh:serviceKey/signSign data with a key
okms:apiovh:serviceKey/verifyVerify a signature
okms:apiovh:serviceKey/datakeyGenerate a data key
okms:apiovh:serviceKey/datakeyDecryptDecrypt a data key
okms:apiovh:secret/getList secrets and metadata
okms:apiovh:secret/createCreate a secret
okms:apiovh:secret/updateUpdate secret metadata
okms:apiovh:secret/deleteDelete a secret
okms:apiovh:secret/version/getDataRead secret version content
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
Info

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

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

Suggested IAM policies

Apply these templates to your OKMS domain resource (urn:v1:<region>:resource:okms:<okmsId>). 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:*"]
}

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:apiovh:log/get"
  ]
}

Add okms:apiovh:secret/version/getData if the identity must 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:apiovh:serviceKey/get",
    "okms:apiovh:serviceKey/encrypt",
    "okms:apiovh:serviceKey/decrypt",
    "okms:apiovh:serviceKey/sign",
    "okms:apiovh:serviceKey/verify",
    "okms:apiovh:serviceKey/datakey",
    "okms:apiovh:serviceKey/datakeyDecrypt"
  ]
}

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/version/getData"
  ]
}

Add okms:apiovh:secret/create, okms:apiovh:secret/update, and okms:apiovh:secret/delete if the identity must manage secrets.

Warning

KMIP operations use okms:kmip:* actions, not okms:apiovh:*. 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?