A AuthMS API Wiki API Reference iam.tianv.com →

POST /admin/oauth/clients/{client_id}/secrets

为指定客户端创建一个新密钥(secret_value 仅返回一次)。最多支持2个有效密钥。

OAuth 客户端管理 `bearerAuth` application/json

Request Parameters

NameInTypeRequiredDefaultExampleConstraintsDescription
client_id path string Yes 客户端ID

Responses

StatusDescriptionSchema
201新密钥(含 secret_value,仅返回一次)dto.CreateClientSecretDetailResponse
400请求参数错误gitee_com_linmes_authms_base_dto.SimpleResponse
401未认证:请提供有效的 Bearer Tokengitee_com_linmes_authms_base_dto.SimpleResponse
403权限不足:需要管理员权限gitee_com_linmes_authms_base_dto.SimpleResponse
404客户端不存在或不属于当前租户gitee_com_linmes_authms_base_dto.SimpleResponse
409冲突:已达到密钥数量上限(最多2个)gitee_com_linmes_authms_base_dto.SimpleResponse
500服务内部错误gitee_com_linmes_authms_base_dto.SimpleResponse

Referenced Schemas

dto.CreateClientSecretDetailResponse

FieldTypeRequiredExampleConstraintsDescription
code integer No
data dto.CreateClientSecretResponse No
message string No
timestamp string No

dto.CreateClientSecretResponse

OAuth客户端密钥创建结果,secret_value 仅在此响应中返回一次

FieldTypeRequiredExampleConstraintsDescription
created_at string No 2026-04-15T10:30:00Z
secret_id string No secret-abc123
secret_value string No sec_xyz789...
status string No active

gitee_com_linmes_authms_base_dto.SimpleResponse

FieldTypeRequiredExampleConstraintsDescription
code integer No
message string No
timestamp string No