You need to enable JavaScript to run this app.
文档中心
智能体身份和权限管理平台

智能体身份和权限管理平台

复制全文
下载 pdf
身份凭据管理
GetRoleCredentials - 获取角色凭据
复制全文
下载 pdf
GetRoleCredentials - 获取角色凭据

获取角色的临时访问凭据

调试

请求参数

下表仅列出该接口特有的请求参数和部分公共参数。更多信息请见公共参数

参数
类型
是否必填
示例值
描述
Action
String

GetRoleCredentials

要执行的操作,取值:GetRoleCredentials。

Version
String

2025-10-30

API的版本,取值:2025-10-30。

DurationSeconds
Integer

3600

临时密钥有效时长(单位:秒)

ProviderName
String

rolecp1

角色凭据提供商名称

IdentityToken
String

identity-token-123

身份凭证

PoolName
String

default

工作负载池名称

RoleSessionName
String

pass-vault

角色会话名称

RequestedRoleTrn
String

trn:iam::123456789:role/example

请求的角色TRN

WithOIDC
Boolean

example

是否使用AssumeRoleWithOIDC

返回参数

下表仅列出本接口特有的返回参数。更多信息请参见返回结构

参数
类型
示例值
描述
VolcEngResponse
Object

{"Credentials":{"AccessKeyId":"AKIA...","SecretAccessKey":"SK...","SessionToken":"STS...","CurrentTime":"2026-01-01T00:00:00Z","Expiration":"2026-01-01T01:00:00Z"}}

火山引擎临时凭据响应

请求示例

POST /?Action=GetRoleCredentials&Version=2025-10-30 HTTP/1.1
Host: id.cn-beijing.volcengineapi.com
Content-Type: application/json; charset=UTF-8

{
  "IdentityToken": "example",
  "ProviderName": "example",
  "PoolName": "default",
  "RequestedRoleTrn": "trn:iam::123456789:role/example"
}

返回示例

{
  "ResponseMetadata": {
    "Action": "GetRoleCredentials"
  },
  "Result": {
    "VolcEngResponse": {
      "Credentials": {
        "AccessKeyId": "AKIA...",
        "SecretAccessKey": "SK...",
        "SessionToken": "STS...",
        "CurrentTime": "2026-01-01T00:00:00Z",
        "Expiration": "2026-01-01T01:00:00Z"
      }
    }
  }
}

错误码

下表为您列举了该接口与业务逻辑相关的错误码。公共错误码请参见公共错误码文档。

状态码
错误码
错误信息
说明
400
MissingParameter.{parameter}

The required parameter %s is missing.

必填参数缺失错误

400
InvalidParameter.{parameter}

The parameter %s is invalid.

参数不合法

400
InvalidRequest

The request is invalid or malformed.

无效请求

400
MissingAction

The request is missing an action.

请求缺少Action

400
InvalidAction

The specified action is invalid.

不合法的Action

401
SignatureNotMatch

The request signature provided is incorrect.

签名缺失或错误

403
AccessDenied

You are not authorized to perform this action.

请求未通过权限验证

403
InvalidAccessKeyId

The access key ID provided is not valid.

不合法的Access Key ld

404
NotFound

Resource not found: %s.

资源不存在

409
Duplicated

Resource already exists: %s.

资源已存在

429
Throttling

The request is denied due to request throttling.

请求被限流

429
QuotaExceeded

Quota exceeded: %s.

配额已达上限

500
InternalError

Internal server error: %s.

内部服务错误

500
DownstreamServerError

An error has occurred due to an unreachable service.

下游服务请求失败

503
ServiceUnavailable

The request has failed due to a temporary failure of the server.

服务不可用

最近更新时间:2026.07.16 14:05:18
这个页面对您有帮助吗?
有用
有用
无用
无用