Ana içeriğe geç

Set Consumer Token Settings

Endpoint​

PUT /apiops/projects/{projectName}/consumers/{consumerKey}/token-settings

Authentication​

Requires a Personal API Access Token.

Authorization: Bearer YOUR_TOKEN

Request​

Path Parameters​

ParameterTypeRequiredDescription
projectNamestringYesProject name
consumerKeystringYesConsumer key, assigned by the installation. Returned as consumerKey by every consumer response

Request Body​

{
"grantType": "PASSWORD",
"tokenNeverExpires": false,
"tokenExpiresInAmount": 3600,
"tokenExpiresInUnit": "SECONDS",
"refreshTokenAllowed": true,
"refreshTokenCount": 1,
"refreshTokenExpiresInAmount": 7200,
"refreshTokenExpiresInUnit": "SECONDS",
"allowUrlParameters": false,
"jwtSignatureAlgorithm": "RS256",
"deletePrevious": false
}

The fields are the same as in Set Token Settings of the Credentials API. All fields are optional. A missing body answers 400 malformedRequest (params.reason = bodyRequired).

Warning

A consumer that a live identity source manages (LDAP, OIDC, database or API sync) cannot be edited. The request answers 400 malformedRequest with params.reason = ldapManaged. Change such a consumer in the identity source.

Response​

200 OK.

The response is a write response. result is the consumer. runtimeDeployment.state is IN_SYNC when every environment acknowledged the change, or DEGRADED when the change is stored but at least one environment did not acknowledge it. Do not retry a DEGRADED write; redeploy instead. resourceVersion is not returned.

Permissions​

  • User must have IDENTITY + MANAGE permission in the project
  • A project outside the scope of the caller answers 404 resourceNotFound, never 403
  • The admin project has no consumers: a call on it answers 400 malformedRequest (params.reason = platformScopeNotSupported)