Untuk single sign-on (SSO) berbasis peran yang menggunakan Security Assertion Markup Language (SAML), panggil operasi AssumeRoleWithSAML untuk mendapatkan kredensial identitas sementara (token Security Token Service (STS)) untuk peran RAM.
Deskripsi operasi
Prerequisites
-
Obtain a SAML response from an external identity provider (IdP).
-
Create a SAML identity provider in Resource Access Management (RAM). For more information, see Create a SAML identity provider or CreateSAMLProvider.
-
Create a RAM role for a SAML identity provider. For more information, see Create a RAM role for an identity provider or CreateRole.
Coba sekarang
Test
RAM authorization
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| SAMLProviderArn |
string |
No |
Nama Sumber Daya Alibaba Cloud Penyedia Identitas SAML yang dibuat di RAM. Format: Anda dapat melihat Nama Sumber Daya Alibaba Cloud IdP di Konsol RAM atau dengan memanggil operasi API:
|
acs:ram::123456789012****:saml-provider/company1 |
| RoleArn |
string |
No |
Nama Sumber Daya Alibaba Cloud Peran RAM yang akan diasumsikan. Entitas tepercaya Peran RAM adalah Penyedia Identitas SAML. Untuk informasi selengkapnya, lihat Membuat peran RAM untuk penyedia identitas atau CreateRole. Format: Anda dapat melihat Nama Sumber Daya Alibaba Cloud peran di Konsol RAM atau dengan memanggil operasi API:
|
acs:ram::123456789012****:role/adminrole |
| SAMLAssertion |
string |
No |
Pernyataan SAML yang dienkode Base64. Nilai harus memiliki panjang 4 hingga 100.000 karakter. Catatan
Ambil tanggapan SAML lengkap dari IdP. Jangan hanya menggunakan bidang pernyataan SAML. |
base64_encoded_saml_assertion |
| Policy |
string |
No |
Kebijakan akses untuk membatasi lebih lanjut izin token STS. Parameter ini berfungsi sebagai berikut:
Nilai harus memiliki panjang 1 hingga 2.048 karakter. |
url_encoded_policy |
| DurationSeconds |
integer |
No |
Durasi kedaluwarsa token. Unit: detik. Nilai minimum adalah 900 detik. Nilai maksimum adalah nilai parameter Anda dapat mengatur parameter |
3600 |
Karena operasi AssumeRoleWithSAML menggunakan pernyataan SAML untuk autentikasi identitas dan mengizinkan akses anonim, Anda tidak perlu menentukan parameter permintaan umum Signature, SignatureMethod, SignatureVersion, atau AccessKeyId. Untuk informasi selengkapnya tentang parameter permintaan umum, lihat Parameter permintaan umum.
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
The response parameters. |
||
| RequestId |
string |
The request ID. |
6894B13B-6D71-4EF5-88FA-F32781734A7F |
| SAMLAssertionInfo |
object |
The information about the SAML assertion. |
|
| SubjectType |
string |
The format of the NameID element in the SAML assertion. If the prefix is |
persistent |
| Subject |
string |
The value of the |
alice@example.com |
| Issuer |
string |
The value of the |
http://example.com/adfs/services/trust |
| Recipient |
string |
The value of the |
https://signin.aliyun.com/saml-role/SSO |
| AssumedRoleUser |
object |
The temporary identity of the assumed role. |
|
| AssumedRoleId |
string |
The ID of the temporary identity. |
34458433936495****:alice |
| Arn |
string |
The ARN of the temporary identity. |
acs:sts::123456789012****:assumed-role/AdminRole/alice |
| Credentials |
object |
The access credential. |
|
| SecurityToken |
string |
The security token. Catatan
The security token has a variable length. Do not impose a maximum length limit on the security token. |
******** |
| Expiration |
string |
The expiration time of the token. The time is in UTC. |
2015-04-09T11:52:19Z |
| AccessKeySecret |
string |
The AccessKey secret. |
wyLTSmsyPGP1ohvvw8xYgB29dlGI8KMiH2pK**** |
| AccessKeyId |
string |
The AccessKey ID. |
STS.L4aBSCSJVMuKg5U1**** |
| SourceIdentity |
string |
The source identity. When you assume a role, you can specify a source identity for the role user. The source identity is used as the initial identity of the session. The value of the source identity persists throughout chained role-assuming sessions and cannot be changed. This ensures the traceability and security of operations. This parameter is not returned if you do not set a source identity. |
Alice |
Contoh
Respons sukses
JSONformat
{
"RequestId": "6894B13B-6D71-4EF5-88FA-F32781734A7F",
"SAMLAssertionInfo": {
"SubjectType": "persistent",
"Subject": "alice@example.com",
"Issuer": "http://example.com/adfs/services/trust",
"Recipient": "https://signin.aliyun.com/saml-role/SSO"
},
"AssumedRoleUser": {
"AssumedRoleId": "34458433936495****:alice",
"Arn": "acs:sts::123456789012****:assumed-role/AdminRole/alice"
},
"Credentials": {
"SecurityToken": "********",
"Expiration": "2015-04-09T11:52:19Z",
"AccessKeySecret": "wyLTSmsyPGP1ohvvw8xYgB29dlGI8KMiH2pK****",
"AccessKeyId": "STS.L4aBSCSJVMuKg5U1****"
},
"SourceIdentity": "Alice"
}
Kode kesalahan
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 500 | InternalError | STS Server Internal Error happened, please send the RequestId to us. |
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.