获取OAuth2凭据提供商
下表仅列出该接口特有的请求参数和部分公共参数。更多信息请见公共参数。
参数 | 类型 | 是否必填 | 示例值 | 描述 |
|---|---|---|---|---|
Action | String | 是 | GetOauth2CredentialProvider | 要执行的操作,取值:GetOauth2CredentialProvider。 |
Version | String | 是 | 2025-10-30 | API的版本,取值:2025-10-30。 |
Name | String | 是 | test-123 | 名称 |
PoolName | String | 否 | default | 工作负载池名称 |
下表仅列出本接口特有的返回参数。更多信息请参见返回结构。
参数 | 类型 | 示例值 | 描述 |
|---|---|---|---|
ProjectName | String | default | 项目名称 |
Name | String | test-123 | 名称 |
CredentialProviderTrn | String | trn:id:${Region}:${Account}:workloadpool/${WorkloadPoolName}/oauth2credentialprovider/${Name} | CredentialProviderTrn field. |
SecretTrn | String | trn:kms:cn-beijing:210000:secrets/managed_identity_default.test | SecretTrn field. |
Vendor | Integer | 0 | 类型 |
Config | Object | {"ClientID": "example", "ClientSecret": "example", "Oauth2Discovery": {"DiscoveryUrl": "example"} | 配置 |
CreatedAt | String | 2025-10-30T07:59:24Z | 创建时间 |
UpdatedAt | String | 2025-10-30T07:59:24Z | 更新时间 |
PoolName | String | default | 工作负载池名称 |
DcrClientInfo | Object | {'ClientId': 'eyJ***LjgQ', 'ClientIdIssuedAt': 1765314961, 'ClientMetadata': {'ClientName': 'test-1', 'ClientUri': 'https://absz.com', 'GrantTypes': ['authorization_code', 'refresh_token'], 'RedirectUris': ['http://localhost:6789/api/v1/oauth2_callback'], 'ResponseTypes': ['code'], 'TokenEndpointAuthMethod': 'none'}, 'RegistrationClientUri': '/auth/oauth/register/12345'} | Dynamic Client Registration相关信息 |
POST /?Action=GetOauth2CredentialProvider&Version=2025-10-30 HTTP/1.1 Host: id.cn-beijing.volcengineapi.com Content-Type: application/json; charset=UTF-8 X-Date: 20250930T050139Z X-Content-Sha256: 287e874e******d653b44d21e Authorization: HMAC-SHA256 Credential=Adfks******wekfwe/20250930/cn-beijing/id/request, SignedHeaders=host;x-content-sha256;x-date, Signature=47a7d934ff7b37c03938******cd7b8278a40a1057690c401e92246a0e41085f { "Name": "example" }
{ "ResponseMetadata": { "RequestId": "20250929220143192030252201AACD74", "Action": "GetOauth2CredentialProvider", "Version": "2025-10-30", "Service": "id", "Region": "cn-beijing" }, "Result": { "Name": "example", "CredentialProviderTrn": "example", "SecretTrn": "example", "Vendor": "example", "Config": { "ClientId": "example", "ClientSecret": "example", "Oauth2Discovery": { "AuthorizationServerMetadata": {}, "DiscoveryUrl": "example" }, "MaxExpires": "example", "Flow": "example", "Scopes": ["example"], "RedirectUrl": "example", "ForceAuthentication": 1, "CustomParameters": { "Entries": [ { "Key": "example", "Value": "example" } ] } }, "CreatedAt": "example", "UpdatedAt": "example" } }
下表为您列举了该接口与业务逻辑相关的错误码。公共错误码请参见公共错误码文档。
状态码 | 错误码 | 说明 |
|---|---|---|
400 | MissingParameter.{parameter} | 必填参数缺失错误 |
400 | InvalidParameter.{parameter} | 参数不合法 |
400 | InvalidRequest | 无效请求 |
400 | MissingAction | 请求缺少Action |
400 | InvalidAction | 不合法的Action |
401 | SignatureNotMatch | 签名缺失或错误 |
403 | AccessDenied | 请求未通过权限验证 |
403 | InvalidAccessKeyId | 不合法的Access Key ld |
404 | NotFound | 资源不存在 |
409 | Duplicated | 资源已存在 |
429 | Throttling | 请求被限流 |
429 | QuotaExceeded | 配额已达上限 |
500 | InternalError | 内部服务错误 |
500 | DownstreamServerError | 下游服务请求失败 |
503 | ServiceUnavailable | 服务不可用 |