All Products
Search
Document Center

Identity as a Service:SetApplicationSsoConfig

Last Updated:Jun 10, 2026

Mengatur properti single sign-on (SSO) untuk aplikasi IDaaS.

Deskripsi operasi

In IDaaS, the Application Management feature lets you add applications that use various SSO protocols, such as SAML 2.0 and OpenID Connect (OIDC). However, each application can support only one SSO protocol. The protocol is specified during application creation and cannot be changed afterward. You must configure the SSO parameters according to the protocol that your application uses.

Coba sekarang

Coba API ini di OpenAPI Explorer tanpa perlu penandatanganan manual. Panggilan yang berhasil akan secara otomatis menghasilkan contoh kode SDK sesuai dengan parameter Anda. Unduh kode tersebut dengan kredensial bawaan yang aman untuk penggunaan lokal.

Test

RAM authorization

Tabel berikut menjelaskan otorisasi yang diperlukan untuk memanggil API ini. Anda dapat menentukannya dalam kebijakan Resource Access Management (RAM). Kolom pada tabel dijelaskan sebagai berikut:

  • Action: Aksi yang dapat digunakan dalam elemen Action pada pernyataan kebijakan izin RAM untuk memberikan izin guna melakukan operasi tersebut.

  • API: API yang dapat Anda panggil untuk melakukan aksi tersebut.

  • Access level: Tingkat akses yang telah ditentukan untuk setiap API. Nilai yang valid: create, list, get, update, dan delete.

  • Resource type: Jenis resource yang mendukung otorisasi untuk melakukan aksi tersebut. Ini menunjukkan apakah aksi tersebut mendukung izin tingkat resource. Resource yang ditentukan harus kompatibel dengan aksi tersebut. Jika tidak, kebijakan tersebut tidak akan berlaku.

    • Untuk API dengan izin tingkat resource, jenis resource yang diperlukan ditandai dengan tanda bintang (*). Tentukan Nama Sumber Daya Alibaba Cloud (ARN) yang sesuai dalam elemen Resource pada kebijakan.

    • Untuk API tanpa izin tingkat resource, ditampilkan sebagai All Resources. Gunakan tanda bintang (*) dalam elemen Resource pada kebijakan.

  • Condition key: Kunci kondisi yang didefinisikan oleh layanan. Kunci ini memungkinkan kontrol granular, berlaku baik hanya untuk aksi maupun untuk aksi yang terkait dengan resource tertentu. Selain kunci kondisi spesifik layanan, Alibaba Cloud menyediakan serangkaian common condition keys yang berlaku di semua layanan yang didukung RAM.

  • Dependent action: Aksi dependen yang diperlukan untuk menjalankan aksi tersebut. Untuk menyelesaikan aksi tersebut, pengguna RAM atau role RAM harus memiliki izin untuk melakukan semua aksi dependen.

Action

Access level

Resource type

Condition key

Dependent action

eiam:SetApplicationSsoConfig

create

*Application

acs:eiam:{#regionId}:{#accountId}:instance/{#InstanceId}/application/{#ApplicationId}

None None

Parameter permintaan

Parameter

Type

Required

Description

Example

InstanceId

string

Yes

ID instans.

idaas_ue2jvisn35ea5lmthk267xxxxx

ApplicationId

string

Yes

ID aplikasi.

app_mkv7rgt4d7i4u7zqtzev2mxxxx

SamlSsoConfig

object

No

Properti SSO untuk aplikasi yang menggunakan protokol SAML.

SpSsoAcsUrl

string

No

The SAML assertion consumer service (ACS) URL of the application (service provider).

https://signin.aliyun.com/saml-role/sso

SpEntityId

string

No

The entity ID of the application (service provider) that uses SAML.

urn:alibaba:cloudcomputing

NameIdFormat

string

No

The format of the NameID in the SAML protocol. Valid values:

  • urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified: The format is not specified. The application determines how to parse the NameID.

  • urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress: The email address format.

  • urn:oasis:names:tc:SAML:2.0:nameid-format:persistent: The persistent NameID.

  • urn:oasis:names:tc:SAML:2.0:nameid-format:transient: The transient NameID.

Valid values:

  • urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified :

    未指定的,默认值。

  • urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress :

    Email 地址格式

  • urn:oasis:names:tc:SAML:2.0:nameid-format:persistent :

    持久化的。

  • urn:oasis:names:tc:SAML:2.0:nameid-format:transient :

    瞬时的。

urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified

NameIdValueExpression

string

No

The expression used to generate the value of the NameID in the SAML protocol.

user.email

DefaultRelayState

string

No

The default value of RelayState. When an SSO request is initiated by IDaaS, the SAML response provided by IDaaS contains this value for RelayState.

https://home.console.alibabacloud.com

SignatureAlgorithm

string

No

The signature algorithm for the SAML assertion.

Valid values:

  • RSA-SHA256 :

    RSA-SHA256 算法

RSA-SHA256

ResponseSigned

boolean

No

Specifies whether the response must be signed. ResponseSigned and AssertionSigned cannot both be false.

  • true: The response must be signed.

  • false: The response does not need to be signed.

true

AssertionSigned

boolean

No

Specifies whether the assertion must be signed. ResponseSigned and AssertionSigned cannot both be false.

  • true: The assertion must be signed.

  • false: The assertion does not need to be signed.

true

AttributeStatements

array<object>

No

The configurations of additional user attributes in the SAML assertion.

object

No

AttributeName

string

No

The name of the attribute in the SAML assertion.

https://www.aliyun.com/SAML-Role/Attributes/RoleSessionName

AttributeValueExpression

string

No

The expression used to generate the value of the attribute in the SAML assertion.

user.username

IdPEntityId

string

No

The entity ID of the identity provider (IdP) in the SAML protocol. The value can be in a URL or URN format.

https://example.com/

OptionalRelayStates

array<object>

No

The optional RelayState configurations.

object

No

The optional RelayState configuration.

RelayState

string

No

The value of RelayState.

https://ram.console.alibabacloud.com/

DisplayName

string

No

The display name of the RelayState.

Ram

OidcSsoConfig

object

No

Properti SSO untuk aplikasi yang menggunakan protokol OIDC.

RedirectUris

array

No

The list of redirect URIs that the application supports.

string

No

The redirect URI that the application supports.

https://example.com/oidc/login/callback

PostLogoutRedirectUris

array

No

The list of post-logout redirect URIs that the application supports.

string

No

The whitelisted post-logout redirect URI of the application. When the application initiates a logout request, you can specify the post_logout_redirect_uri parameter.

https://example.com/oidc/logout/callback

GrantTypes

array

No

The list of OIDC grant types that are supported.

authorization_code

string

No

The OIDC grant type. Valid values:

  • authorization_code: The authorization code grant type.

  • implicit: The implicit grant type.

  • refresh_token: The refresh token grant type.

  • urn:ietf:params:oauth:grant-type:device_code: The device authorization grant type.

  • password: The resource owner password credentials grant type.

authorization_code

ResponseTypes

array

No

The response type supported by the application when OidcSsoConfig.GrantTypes is set to implicit.

token id_token

string

No

The ResponseType parameter in the OIDC protocol. This parameter is valid only when GrantTypes is set to implicit. Valid values:

  • token: Returns only an access token.

  • id_token: Returns only an ID token.

  • token id_token: Returns both an access token and an ID token.

token id_token

GrantScopes

array

No

The scope parameter in the OIDC protocol. This parameter specifies the scope of user information that can be returned by the userinfo endpoint or included in the ID token.

profile,email

string

No

The scope parameter in the OIDC protocol. This parameter specifies the scope of user information that can be returned by the userinfo endpoint or included in the ID token. Valid values:

  • openid: An OIDC standard parameter that indicates the unique ID of the user.

  • profile: The detailed information about the user.

  • email: The email address of the user.

  • phone: The phone number of the user.

openid

PasswordTotpMfaRequired

boolean

No

Specifies whether Time-based One-time Password (TOTP) multi-factor authentication (MFA) is required for the resource owner password credentials grant type. This parameter is valid only when the GrantTypes for the OIDC application is set to password.

true

PasswordAuthenticationSourceId

string

No

The ID of the identity source for the resource owner password credentials grant type. This parameter is valid only when the GrantTypes for the OIDC application is set to password.

ia_password

PkceRequired

boolean

No

Specifies whether Proof Key for Code Exchange (PKCE) (RFC 7636) is required for application SSO.

true

PkceChallengeMethods

array

No

The algorithm used to compute the code challenge in PKCE.

S256

string

No

The algorithm used to compute the code challenge in PKCE. Valid values:

  • plain: The code challenge is the same as the code verifier.

  • S256: The SHA-256 algorithm.

S256

AccessTokenEffectiveTime

integer

No

The validity period of the access token. Unit: seconds. Default value: 1200 (20 minutes).

1200

CodeEffectiveTime

integer

No

The validity period of the authorization code. Unit: seconds. Default value: 60 (1 minute).

60

IdTokenEffectiveTime

integer

No

The validity period of the ID token. Unit: seconds. Default value: 300 (5 minutes).

300

RefreshTokenEffective

integer

No

The validity period of the refresh token. Unit: seconds. Default value: 86400 (1 day).

86400

CustomClaims

array<object>

No

The custom claims that are returned in the ID token.

object

No

ClaimName

string

No

The name of the claim.

"Role"

ClaimValueExpression

string

No

The expression used to generate the value of the claim.

user.dict.applicationRole

SubjectIdExpression

string

No

The expression used to generate the value of the sub claim in the ID token.

user.userid

AllowedPublicClient

boolean

No

Specifies whether the application is allowed to act as a public client to request the IDaaS authorization server. This parameter can be enabled only for the authorization code grant type and the device authorization grant type. Default value: false.

true

InitLoginType

string

No

Metode inisiasi SSO. Nilai valid:

  • only_app_init_sso: SSO hanya diinisiasi oleh aplikasi. Ini adalah nilai default untuk aplikasi OIDC. Jika Anda mengatur parameter ini ke nilai ini untuk aplikasi SAML, Anda harus menentukan InitLoginUrl.

  • idaas_or_app_init_sso: SSO dapat diinisiasi oleh konsol IDaaS atau aplikasi. Ini adalah nilai default untuk aplikasi SAML. Jika Anda mengatur parameter ini ke nilai ini untuk aplikasi OIDC, Anda harus menentukan InitLoginUrl.

only_app_init_sso

InitLoginUrl

string

No

URL yang digunakan untuk menginisiasi SSO. Anda harus menentukan parameter ini jika Anda mengatur InitLoginType ke idaas_or_app_init_sso untuk aplikasi OIDC. Anda harus menentukan parameter ini jika Anda mengatur InitLoginType ke only_app_init_sso untuk aplikasi SAML.

http://127.0.0.1:8000/start_login?enterprise_code=ABCDEF

ClientToken

string

No

Token klien yang digunakan untuk memastikan idempotensi permintaan. Anda dapat menggunakan klien untuk menghasilkan nilai, tetapi Anda harus memastikan bahwa nilai tersebut unik di antara permintaan yang berbeda. Token hanya dapat berisi karakter ASCII dan tidak boleh melebihi 64 karakter. Untuk informasi lebih lanjut, lihat Cara memastikan idempotensi.

client-examplexxx

Elemen respons

Element

Type

Description

Example

object

RequestId

string

The request ID.

0441BD79-92F3-53AA-8657-F8CE4A2B912A

Contoh

Respons sukses

JSONformat

{
  "RequestId": "0441BD79-92F3-53AA-8657-F8CE4A2B912A"
}

Kode kesalahan

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.