ObtainCredential - 查询一个含敏感信息的凭据

更新时间:
复制为 MD 格式

查询一个凭据信息,获取凭据明文。

接口说明

该 API 基于 IDaaS 签发的 Access Token 进行身份认证和鉴权。

请确保传入的 Access Token 具备访问 IDaaS 内置 PAM 应用(Privileged Access Management)的“获取静态凭据”的功能授权。

说明

对应的 scope 为 urn:cloud:idaas:pam|credential:obtain

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

调试

授权信息

当前API暂无授权信息透出。

请求语法

GET /v2/{instanceId}/credentials/_/actions/obtain HTTP/1.1

路径参数

名称

类型

必填

描述

示例值

instanceId

string

EIAM 实例 ID。

idaas_ue2jvisn35ea5lmthk267xxxxx

请求参数

名称

类型

必填

描述

示例值

Authorization

string

认证信息。 格式为:Bearer ${access_token}。

说明

请输入 IDaaS 签发的 Access Token。

Bearer xxxxxx

credentialIdentifier

string

凭据标识。

credential_identifier_test

返回参数

名称

类型

描述

示例值

object

instanceId

string

EIAM 实例 ID。

idaas_ue2jvisn35ea5lmthk267xxxxx

credentialId

string

凭据 ID。

cred_mkv7rgt4d7i4u7zqtzev2mxxxx

status

string

凭据状态。取值可选范围:

  • enabled:启用。

  • disabled:禁用。

enabled

credentialIdentifier

string

凭据标识。

credential_identifier_test

credentialName

string

凭据名称。

credential_name

credentialSubjectType

string

凭据所属的主体类型。取值可选范围:

  • authentication_token_provider:认证令牌提供商。

authentication_token_provider

credentialSubjectId

string

凭据所属的主体 ID。

apt_werthgfdsasffxxxxx

credentialScenarioLabel

string

凭据的使用场景标签。取值可选范围:

  • llm:大模型。

  • saas:三方 SaaS 服务。

llm

credentialType

string

凭据类型。取值可选范围:

  • api_key:API Key 认证凭证。

  • oauth_client:OAuth 客户端认证凭证。

api_key

credentialCreationType

string

凭据的创建类型。取值可选范围:

  • system_init:系统创建。

  • user_custom:用户创建。

user_custom

description

string

凭据描述。

credential_description

createTime

integer

创建时间,Unix 时间戳格式,单位为毫秒。

1649830225000

updateTime

integer

更新时间,Unix 时间戳格式,单位为毫秒。

1649830227000

credentialContent

object

凭据的内容。

oauthClientContent

object

OAuth 客户端认证凭证类型的凭据内容。

clientId

string

OAuth 协议的 client_id。

dmvncmxersdxxxxxx

clientSecret

string

OAuth 协议的 client_secret。

nsklnertyt5ddwizncxxxx

apiKeyContent

object

API Key 凭证类型的凭据内容。

apiKey

string

API Key 的值。

sk-nsklncmwizncxxxx

credentialSharingScope

string

凭据共享范围

user_exclusive

exclusiveUserId

string

凭据专属账户 ID

user_xxx

示例

正常返回示例

JSON格式

{
  "instanceId": "idaas_ue2jvisn35ea5lmthk267xxxxx",
  "credentialId": "cred_mkv7rgt4d7i4u7zqtzev2mxxxx",
  "status": "enabled",
  "credentialIdentifier": "credential_identifier_test",
  "credentialName": "credential_name",
  "credentialSubjectType": "authentication_token_provider",
  "credentialSubjectId": "apt_werthgfdsasffxxxxx",
  "credentialScenarioLabel": "llm",
  "credentialType": "api_key",
  "credentialCreationType": "user_custom",
  "description": "credential_description",
  "createTime": 1649830225000,
  "updateTime": 1649830227000,
  "credentialContent": {
    "oauthClientContent": {
      "clientId": "dmvncmxersdxxxxxx",
      "clientSecret": "nsklnertyt5ddwizncxxxx"
    },
    "apiKeyContent": {
      "apiKey": "sk-nsklncmwizncxxxx\n"
    }
  },
  "credentialSharingScope": "user_exclusive",
  "exclusiveUserId": "user_xxx"
}

错误码

访问错误中心查看更多错误码。

变更历史

更多信息,参考变更详情