Memanggil operasi AssumeRoleWithOIDC untuk mendapatkan kredensial identitas sementara (Token Layanan Token Keamanan) guna mengasumsikan peran RAM pada single sign-on (SSO) berbasis peran yang menggunakan OpenID Connect (OIDC).
Deskripsi operasi
Prerequisites
Obtain an OpenID Connect (OIDC) token from an external identity provider (IdP).
Create an OIDC identity provider in RAM. For more information, see Create an OIDC identity provider or CreateOIDCProvider.
Create a RAM role that uses an OIDC identity provider as the trusted entity. For more information, see Create a RAM role for a trusted identity provider or CreateRole.
Coba sekarang
Test
RAM authorization
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| OIDCProviderArn |
string |
No |
Nama Sumber Daya Alibaba Cloud penyedia identitas OIDC. Anda dapat melihat Nama Sumber Daya Alibaba Cloud penyedia identitas OIDC di Konsol RAM atau dengan memanggil operasi API:
|
acs:ram::113511544585****:oidc-provider/TestOidcIdp |
| RoleArn |
string |
No |
Nama Sumber Daya Alibaba Cloud peran RAM yang ingin Anda asumsikan. Anda dapat melihat Nama Sumber Daya Alibaba Cloud peran di Konsol RAM atau dengan memanggil operasi API:
|
acs:ram::113511544585****:role/testoidc |
| OIDCToken |
string |
No |
Token OIDC yang diterbitkan oleh IdP eksternal. Panjang token harus 4 hingga 20.000 karakter. Catatan
Masukkan token OIDC asli. Jangan melakukan dekode Base64 pada token. |
eyJraWQiOiJKQzl3eHpyaHFKMGd0**** |
| Policy |
string |
No |
Kebijakan akses untuk membatasi izin token STS lebih lanjut.
Panjang kebijakan harus 1 hingga 2.048 karakter. |
{"Statement": [{"Action": ["*"],"Effect": "Allow","Resource": ["*"]}],"Version":"1"} |
| DurationSeconds |
integer |
No |
Periode validitas token, dalam detik. Nilai valid: 900 hingga nilai parameter Untuk informasi selengkapnya tentang cara mengatur parameter |
3600 |
| RoleSessionName |
string |
Yes |
Nama sesi peran. Parameter kustom yang digunakan untuk membedakan sesi peran. Nilai ini biasanya merupakan identitas pengguna yang memanggil operasi, seperti nama pengguna. Di ActionTrail, Anda dapat menggunakan nilai parameter ini untuk mengidentifikasi pengguna yang mengasumsikan peran RAM. Hal ini menyediakan audit akses tingkat pengguna. Nama dapat berisi huruf, digit, periode (.), tanda at (@), tanda hubung (-), dan garis bawah (_). Panjang nama harus 2 hingga 64 karakter. |
TestOidcAssumedRoleSession |
Operasi AssumeRoleWithOIDC menggunakan token OIDC untuk autentikasi identitas dan mengizinkan akses anonim. Oleh karena itu, Anda tidak perlu menentukan parameter permintaan umum Signature, SignatureMethod, SignatureVersion, atau AccessKeyId. Untuk informasi selengkapnya, lihat Parameter umum.
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
The returned parameters. |
||
| RequestId |
string |
The request ID. |
3D57EAD2-8723-1F26-B69C-F8707D8B565D |
| OIDCTokenInfo |
object |
Information about the OIDC token. |
|
| Subject |
string |
The subject of the OIDC token. This corresponds to the value of the |
KryrkIdjylZb7agUgCEf**** |
| Issuer |
string |
The issuer of the OIDC token. This corresponds to the value of the |
https://dev-xxxxxx.okta.com |
| ClientIds |
string |
The audience of the OIDC token. Multiple audiences are separated by commas (,). This corresponds to the value of the |
496271242565057**** |
| ExpirationTime |
string |
The expiration time of the OIDC token. |
2021-10-20T04:27:09Z |
| IssuanceTime |
string |
The time when the OIDC token was issued. |
2021-10-20T03:27:09Z |
| VerificationInfo |
string |
The verification information for the OIDC token. For more information, see Manage OIDC identity providers. |
Success |
| AssumedRoleUser |
object |
The assumed temporary identity. |
|
| AssumedRoleId |
string |
The ID of the temporary identity. |
33157794895460**** |
| Arn |
string |
The ARN of the temporary identity. |
acs:ram::113511544585****:role/testoidc/TestOidcAssumedRoleSession |
| Credentials |
object |
The temporary access credential (STS token). |
|
| SecurityToken |
string |
The security token. Catatan
The length of the security token is not fixed. Do not set a maximum length for the security token. |
CAIShwJ1q6Ft5B2yfSjIr5bSEsj4g7BihPWGWHz**** |
| Expiration |
string |
The time when the token expires, in Coordinated Universal Time (UTC). |
2021-10-20T04:27:09Z |
| AccessKeySecret |
string |
The AccessKey secret. |
CVwjCkNzTMupZ8NbTCxCBRq3K16jtcWFTJAyBEv2**** |
| AccessKeyId |
string |
The AccessKey ID. |
STS.NUgYrLnoC37mZZCNnAbez**** |
| SourceIdentity |
string |
The source identity. The value of this identity persists throughout chained role-assuming sessions and cannot be changed. This ensures operational traceability and security. This parameter is returned only if a source identity is configured. |
Alice |
Contoh
Respons sukses
JSONformat
{
"RequestId": "3D57EAD2-8723-1F26-B69C-F8707D8B565D",
"OIDCTokenInfo": {
"Subject": "KryrkIdjylZb7agUgCEf****",
"Issuer": "https://dev-xxxxxx.okta.com",
"ClientIds": "496271242565057****",
"ExpirationTime": "2021-10-20T04:27:09Z",
"IssuanceTime": "2021-10-20T03:27:09Z",
"VerificationInfo": "Success"
},
"AssumedRoleUser": {
"AssumedRoleId": "33157794895460****",
"Arn": "acs:ram::113511544585****:role/testoidc/TestOidcAssumedRoleSession"
},
"Credentials": {
"SecurityToken": "CAIShwJ1q6Ft5B2yfSjIr5bSEsj4g7BihPWGWHz****",
"Expiration": "2021-10-20T04:27:09Z",
"AccessKeySecret": "CVwjCkNzTMupZ8NbTCxCBRq3K16jtcWFTJAyBEv2****",
"AccessKeyId": "STS.NUgYrLnoC37mZZCNnAbez****"
},
"SourceIdentity": "Alice"
}
Kode kesalahan
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.