Client credentials

A confidential client gets a token for itself, with no user involved.

POST /oauth/token

Confidential clients only. Returns a token for the client itself: no user, no tenant, no refresh token.

Authorization

The client’s secret, as client_secret_basic or client_secret_post. See Client authentication. A public client cannot use this grant.

Body

Form-encoded (application/x-www-form-urlencoded).

FieldTypeRequiredDescription
grant_typestringYesclient_credentials
client_idstringNoRequired with client_secret_post; taken from the Authorization header with client_secret_basic.
client_secretstringNoRequired with client_secret_post.

Response

200, with Cache-Control: no-store. No refresh_token.

{
  "token_type": "Bearer",
  "access_token": "eyJ…",
  "expires_in": 3600
}

Errors

Every refusal is 400 with an RFC 6749 code and nothing else.

StatuserrorWhen
400invalid_requestclient_id is missing or malformed, or differs between header and body.
400invalid_clientUnknown client, a public client, a wrong secret, or a disallowed IP.
400invalid_requestThe host is not an org.
400unsupported_grant_typegrant_type is not one of the five the endpoint accepts.

Example

curl -X POST https://acme.loginwith.dev/oauth/token \
  -u cli_…:secret \
  -d grant_type=client_credentials