Skip to content

API Authentication

SSH-KLM supports multiple authentication methods.

Best for server-to-server integrations.

  1. Navigate to Settings → API Keys
  2. Click Create API Key
  3. Set name, permissions, and expiry
  4. Copy the key (shown only once)
Terminal window
curl -X GET https://api.qcecuring.com/v1/hosts \
-H "Authorization: Bearer sk_live_abc123..."
ScopeDescription
hosts:readList and view hosts
hosts:writeAdd, update, delete hosts
keys:readList and view SSH keys
keys:rotateTrigger key rotation
discovery:runStart discovery scans
admin:*Full administrative access

Best for user-facing applications.

Terminal window
curl -X POST https://api.qcecuring.com/oauth/token \
-H "Content-Type: application/json" \
-d '{
"grant_type": "client_credentials",
"client_id": "YOUR_CLIENT_ID",
"client_secret": "YOUR_CLIENT_SECRET"
}'

Response:

{
"access_token": "eyJhbG...",
"token_type": "Bearer",
"expires_in": 3600
}
Terminal window
curl -X POST https://api.qcecuring.com/oauth/token \
-d "grant_type=refresh_token&refresh_token=YOUR_REFRESH_TOKEN"

SSH-KLM supports SAML 2.0 and OIDC for enterprise SSO.

auth:
oidc:
enabled: true
issuer: "https://auth.example.com"
clientId: ${OIDC_CLIENT_ID}
clientSecret: ${OIDC_CLIENT_SECRET}
scopes: ["openid", "profile", "email"]
  1. Rotate keys regularly - Set expiry on API keys
  2. Use minimum permissions - Grant only required scopes
  3. Secure storage - Never commit keys to version control
  4. Monitor usage - Review API access logs