调用接口
用户扮演角色
请求URL
GET https://sts.163yun.com/v1/assumeRole
请求示例
GET /v1/assumeRole?accessKey=af9f44d508b4747bbdd0430cadc13658&acceptType=json&signatureVersion=1.0&signatureAlgorithm=HMAC-SHA256&signatureNonce=zm×tamp=2017-08-22T05%3A46%3A53.844Z®ion=cn-east-1&roleNrn=ncs%3Asam%3A%3A179234353551769600%3Arole%2Fuser-sts-cy&duration=2000&secretKey=f086dce0d6dfe248eb42543f97c242e2&signature=694cbbd0dc2e3291a29338d41837e0e0b53137ab5f0f050eea0bfa422bc67449
请求参数
参数 | 类型 | 是否必填 | 描述 | 示例值 |
accessKey | String | 是 | 公钥 | af9f44d508b4747bbdd0430cadc13658 |
secretKey | String | 是 | 私钥 | f086dce0d6dfe248eb42543f97c242e2 |
acceptType | String | 是 | 返回类型 | json |
signatureVersion | String | 是 | 签名版本号 | 1.0 |
signatureAlgorithm | String | 是 | 签名算法 | HMAC-SHA256 |
signatureNonce | String | 是 | 随机值 | zm |
signature | String | 是 | 用户签名 | 694cbbd0dc2e3291a29338d41837e0e0b53137ab5f0f050eea0bfa422bc67449 |
timestamp | Long | 是 | UTC时间 | 2017-07-31T08:14:13Z |
region | String | 是 | 可用区 | cn-east-1 |
roleNrn | String | 是 | 角色全局资源描述符 | ncs:ram::1234567890123456:role/samplerole |
duration | Integer | 否 | 过期时间,单位秒。有效范围900~3600,默认3600 | |
响应示例
{
"requestId": "8062d8e6-abcb-455e-969f-fb5a809c53e5",
"code": 200,
"msg": "调用成功",
"result": {
"accessKey": "STS.L4aBSCSJVMuKg5U1vFDw",
"secretKey": "wyLTSmsyPGP1ohvvw8xYgB29dlGI8KMiH2pKCNZ9",
"securityToken": "CAESrAIIARKAAShQquMnLIlbvEcIxO6wCoqJufs8sWwieUxu45hS9AvKNEte8KRUWiJWJ6Y+YHAPgNwi7yfRecMFydL2uPOgBI7LDio0RkbYLmJfIxHM2nGBPdml7kYEOXmJp2aDhbvvwVYIyt/8iES/R6N208wQh0Pk2bu+/9dvalp6wOHF4gkFGhhTVFMuTDRhQlNDU0pWTXVLZzVVMXZGRHciBTQzMjc0KgVhbGljZTCpnJjwySk6BlJzYU1ENUJuCgExGmkKBUFsbG93Eh8KDEFjdGlvbkVxdWFscxIGQWN0aW9uGgcKBW9zczoqEj8KDlJlc291cmNlRXF1YWxzEghSZXNvdXJjZRojCiFhY3M6b3NzOio6NDMyNzQ6c2FtcGxlYm94L2FsaWNlLyo="
"expireTime": 1483932155000
}
}
响应参数
参数 | 类型 | 描述 | 示例值 |
request_id | String | 请求Id | bacf68c0-0033-46c6-af86-ccfa428fee14 |
code | Integer | 错误码 | 200 |
msg | String | 响应消息 | success |
result | Object | 返回结果 | - |
accessKey | String | 公钥 | STS.L4aBSCSJVMuKg5U1vFDw |
secretKey | String | 私钥 | wyLTSmsyPGP1ohvvw8xYgB29dlGI8KMiH2pKCNZ9 |
securityToken | String | STS Token | CAESrAIIA...94L2FsaWNlLyo= |
expireTime | Long | 过期时间 | 1483932155000 |
错误码
code | message |
1001 | 参数错误 |
1003 | 签名不合法 |
1004 | 产品未激活 |
2007 | 角色不存在 |
2013 | 没有对应权限 |
2015 | 禁止主账号访问 |