This topic provides an example of configuring user-based SSO between Microsoft Entra ID (formerly Azure AD) and Alibaba Cloud to demonstrate the end-to-end process of setting up SSO between an IdP and Alibaba Cloud.
Use cases
In this example, an enterprise has an Alibaba Cloud account and a Microsoft Entra ID tenant. The tenant contains an administrator with the Global Administrator role and an employee user, u2. The goal is to configure user-based SSO to allow the employee user (u2) to access Alibaba Cloud after signing in to Microsoft Entra ID.
Prerequisites
-
You have a RAM administrator with the
AliyunRAMFullAccesspermission for operations in the RAM console. For information about how to create a RAM user and grant permissions, see Create a RAM user and Manage RAM user permissions. -
You have a Microsoft Entra ID administrator with the Global Administrator role for operations in Microsoft Entra ID. For information about how to create a user and grant permissions in Microsoft Entra ID, see the Microsoft Entra ID documentation.
Step 1: Get SAML metadata from Alibaba Cloud
-
Sign in to the RAM console as a RAM administrator.
-
In the left-side navigation pane, choose .
-
On the SSO page, click the User-based SSO tab.
-
In the SAML Service Provider Metadata URL section, copy the URL.
-
Open the copied URL in a new browser window and save the metadata XML file locally.
NoteThe metadata XML file contains information about Alibaba Cloud as a SAML service provider. Record the values of
entityIDandLocationfrom this file. These values are required for the configuration in Microsoft Entra ID.
Step 2: Create an app in Microsoft Entra ID
-
Sign in to the Azure portal as a Microsoft Entra ID administrator.
-
In the upper-left corner of the home page, click the
icon. -
In the left-side navigation pane, choose .
-
Click New application.
-
On the Browse Microsoft Entra Gallery page, click Create your own application.
-
On the Create your own application pane, enter an application name, for example,
AliyunSSODemo. Select Integrate any other application you don't find in the gallery (Non-gallery), and then click Create.
Step 3: Configure SAML in Microsoft Entra ID
-
On the AliyunSSODemo page, in the left-side navigation pane, go to .
-
On the Select a single sign-on method page, click SAML.
-
On the Set up Single Sign-On with SAML page, perform the following steps:
-
In the upper-left corner, click Upload metadata file, select the file, and then click Add.
NoteUpload the XML file that you downloaded in Step 1: Get SAML metadata from Alibaba Cloud.
-
In the Basic SAML Configuration section, configure the following settings, and then click Save.
-
Identifier (Entity ID): The value of
entityIDis automatically read from the metadata file. -
Reply URL (Assertion Consumer Service URL): The value of
Locationis automatically read from the metadata file. -
Relay State: The Alibaba Cloud page to which users are redirected after a successful SSO sign-in.
NoteFor security reasons, you can only set the Relay State to a URL under an Alibaba-owned domain, such as
*.aliyun.com,*.hichina.com,*.yunos.com,*.taobao.com,*.tmall.com,*.alibabacloud.com, or*.alipay.com. Otherwise, the configuration is invalid. If you leave this field empty, users are redirected to the Alibaba Cloud console homepage by default.
-
-
In the SAML Certificates section, find Federation Metadata XML and click Download.
-
Step 4: Assign users in Microsoft Entra ID
-
On the AliyunSSODemo page, in the left-side navigation pane, go to .
-
In the upper-left corner, click Add user/group.
-
On the Add Assignment page, select the target user (user u2 in this example), and then click Assignments.
Step 5: Create a RAM user
-
In the left-side navigation pane of the RAM console, choose .
-
On the Users page, click Create User.
-
On the Create User page, in the User Account Information section, enter a Logon Name and a Display Name.
Ensure that the prefix of the logon name for the RAM user is the same as the username prefix in Microsoft Entra ID. In this example, the prefix is u2.
-
In the Access Mode section, select an access mode.
-
Click OK.
Step 6: Enable user SSO in Alibaba Cloud
-
In the left-side navigation pane of the RAM console, choose .
-
On the SSO page, click the User-based SSO tab.
-
In the SSO Status section, click Enabled.
NoteUser-based SSO is a global setting. After it is enabled, all RAM users must use SSO to log on to the console. If you are currently logged on as a RAM user, do not enable this setting until you have fully configured and tested SSO to avoid being locked out of your account. As a best practice, perform this configuration while signed in to your Alibaba Cloud account.
-
In the Metadata File section, click Upload Metadata File and upload the XML file that you obtained in Step 3: Configure SAML in Microsoft Entra ID.
-
In the Auxiliary Domain Name section, click Edit. Enable the auxiliary domain name and configure it with the email suffix of the username in Microsoft Entra ID.
For example, if the full username of the Microsoft Entra ID user (u2) is
u2@example.onmicrosoft.com, enterexample.onmicrosoft.com.
Verify the result
After completing the SSO configuration, you can initiate an SSO sign-in from either Alibaba Cloud (SP-initiated) or Microsoft Entra ID (IdP-initiated).
SP-initiated sign-on
-
On the Overview page of the RAM console, copy the sign-on URL for RAM users.
-
Hover over your profile picture in the upper-right corner and click Log Out, or open the copied RAM user sign-on URL in a new browser window.
-
Click Login with Cloud Account. You are automatically redirected to the Microsoft Entra ID sign-in page.
-
Sign in with the username and password of user u2.
After successful authentication, you are automatically signed in through SSO and redirected to the page specified in Relay State. If Relay State is not specified or is invalid, you are redirected to the Alibaba Cloud console homepage.
In the user menu in the upper-right corner of the console, the current identity is displayed as u2 with the RAM User label, and the account alias is example. This indicates that user-based SSO is successful.
IdP-initiated sign-on
-
Obtain the user access URL.
-
Sign in to the Azure portal as an administrator.
-
In the upper-left corner of the home page, click the
icon. -
In the left-side navigation pane, choose .
-
Click the application AliyunSSODemo.
-
In the left-side navigation pane, click Properties to obtain the user access URL.
The user access URL is the link that users can open in their browser to access this application directly.
-
-
The user (u2) obtains the user access URL from the administrator. In a browser, the user enters the URL and signs in with their account.
After successful authentication, you are automatically signed in through SSO and redirected to the page specified in Relay State. If Relay State is not specified or is invalid, you are redirected to the Alibaba Cloud console homepage.