All Products
Search
Document Center

Data Management:Logon-free access to the DMS console

Last Updated:Jun 12, 2026

You can embed a URL in your development or tooling platform to provide logon-free access to the Data Management (DMS) console. This lets users directly access the DMS console and its features without signing in with an Alibaba Cloud account or as a RAM user. This topic describes how to create a URL for logon-free access.

Procedure

  1. Create a RAM role to access DMS and grant it permissions. Then, create a RAM user and grant the AliyunSTSAssumeRoleAccess permission to the user. For more information, see Prerequisites.

  2. Obtain temporary credentials by assuming the role. These credentials—an AccessKey ID, AccessKey Secret, and a security token—are used to obtain a SigninToken. For more information, see Step 1: Obtain temporary credentials.

  3. Obtain a SigninToken, which is required to create the logon-free access URL. For more information, see Step 2: Obtain a SigninToken.

  4. Create the logon-free access URL. For more information, see Step 3: Create the logon-free access URL.

Maven dependencies

<dependency>
    <groupId>com.aliyun</groupId>
    <artifactId>sts20150401</artifactId>
    <version>1.1.7</version>
</dependency>

<dependency>
    <groupId>com.alibaba</groupId>
    <artifactId>fastjson</artifactId>
    <version>2.0.53</version>
</dependency>

<dependency>
    <groupId>org.apache.httpcomponents</groupId>
    <artifactId>httpclient</artifactId>
    <version>4.5.14</version>
</dependency>

Java code example

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.aliyun.sts20150401.Client;
import com.aliyun.sts20150401.models.*;
import com.aliyun.teaopenapi.models.Config;
import com.aliyun.teautil.models.RuntimeOptions;
import org.apache.http.HttpStatus;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.utils.URIBuilder;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;

import java.io.IOException;
import java.net.URISyntaxException;

/*
  Set up the user and role information.
 */
  String accountId = "Your Alibaba Cloud account ID";
 // The RAM role used to access DMS. Grant the AliyunDMSReadOnlyAccess (read-only) or AliyunDMSFullAccess permission as needed.
  String ramRoleArn = "The ARN of the RAM role that you created in the Prerequisites section";
 // The AccessKey ID and AccessKey Secret of the RAM user. The RAM user must have the AliyunSTSAssumeRoleAccess permission.
  String accessKeyId = "";
  String accessKeySecret = "";
 /*
  Step 1: Call the AssumeRole operation to obtain temporary credentials, including an AccessKey ID, an AccessKey Secret, and a security token.
 */
  AssumeRoleResponse.AssumeRoleResponseBodyCredentials credentials = assumeRole(accountId, accessKeyId, accessKeySecret, ramRoleArn);
  System.out.println("Expiration: " + credentials.getExpiration());
  System.out.println("Access Key Id: " + credentials.getAccessKeyId());
  System.out.println("Access Key Secret: " + credentials.getAccessKeySecret());
  System.out.println("Security Token: " + credentials.getSecurityToken());

  /*
  Step 2: Obtain the SigninToken.
  */
  String signInToken = getSignInToken(credentials.getAccessKeyId(),
  credentials.getAccessKeySecret(),
  credentials.getSecurityToken());
  System.out.println("Your SigninToken is: " + signInToken);

 /*
  Step 3: Create the logon-free access URL. The following example uses the DMS console homepage.
 */
  String pageUrl = getDmsLoginUrl("https://dms.aliyun.com", signInToken);
  System.out.println("Your PageUrl is : " + pageUrl);

Prerequisites

Note

If you meet all the following prerequisites, you can proceed to Step 1.

Step 1: Obtain temporary credentials

Call the AssumeRole operation to obtain temporary credentials by assuming a RAM role. For more information about the AssumeRole operation, see AssumeRole.

The following Java code provides an example:

  /**
  * Obtains temporary credentials by calling the AssumeRole operation.
  */
  private static AssumeRoleResponse.AssumeRoleResponseBodyCredentials assumeRole(
                    String accountId, String accessKeyId,
                    String accessKeySecret, String ramRoleArn) throws Exception {
    // Configure the STS client.
    Config config = new Config()
        .setAccessKeyId(accessKeyId)
        .setAccessKeySecret(accessKeySecret)
        // Note: The endpoint for Security Token Service (STS) is globally fixed. The sts.cn-hangzhou.aliyuncs.com endpoint is typically used.
        .setEndpoint("sts.cn-hangzhou.aliyuncs.com");
    Client client = new Client(config);
    AssumeRoleRequest request = new AssumeRoleRequest();
    // An ARN (Alibaba Cloud Resource Name) is a global resource identifier that specifies a RAM role.
    request.setRoleArn(ramRoleArn);
    // A custom parameter to distinguish between different tokens. This parameter can be used for user-level access auditing. Format: ^[a-zA-Z0-9\.@\-_]+$
    request.setRoleSessionName("session-name");
    request.setDurationSeconds(3600L); // Explicitly set the validity period in seconds.
    RuntimeOptions runtime = new RuntimeOptions();
    AssumeRoleResponse response = client.assumeRoleWithOptions(request, runtime);
    return response.getBody().getCredentials();
  }

Step 2: Obtain a SigninToken

Call the GetSigninToken operation to obtain a SigninToken.

The following Java code provides an example:

  /**
     * Obtains a SigninToken by using a security token.
     *
     * @param accesskeyId
     * @param accessKeySecret
     * @param securityToken
     * @return
     * @throws IOException
     * @throws URISyntaxException
     */
    private static String getSignInToken(String accesskeyId, String accessKeySecret, String securityToken)
        throws IOException, URISyntaxException {
        URIBuilder builder = new URIBuilder("http://signin.aliyun.com/federation");

        builder.setParameter("Action", "GetSigninToken")
            .setParameter("AccessKeyId", accesskeyId)
            .setParameter("AccessKeySecret", accessKeySecret)
            .setParameter("SecurityToken", securityToken)
            .setParameter("TicketType", "normal");

        HttpGet request = new HttpGet(builder.build());
        CloseableHttpClient httpclient = HttpClients.createDefault();

        try (CloseableHttpResponse response = httpclient.execute(request)) {
            if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
                String context = EntityUtils.toString(response.getEntity());
                JSONObject jsonObject = JSON.parseObject(context);
                return jsonObject.getString("SigninToken");
            } else {
                System.out.println(response.getStatusLine());
            }
        }
        return null;
    }

Step 3: Create the logon-free access URL

Note

Each SigninToken is single-use. To create another logon-free access URL, you must obtain a new token.

The following Java code provides an example:

Request example:

private static String getDmsLoginUrl(String pageUrl, String signInToken) throws URISyntaxException {
        URIBuilder builder = new URIBuilder("http://signin.aliyun.com/federation");
        builder.setParameter("Action", "Login");
        // The URL to which the user is redirected when the session expires. This is typically a URL on your web server that is configured for a 302 redirect.
        builder.setParameter("LoginUrl", "https://signin.aliyun.com/login.htm");
        // The DMS page that the user accesses.
        builder.setParameter("Destination", pageUrl);
        builder.setParameter("SigninToken", signInToken);
        HttpGet request = new HttpGet(builder.build());
        return request.getURI().toString();
}

Response example:

Expiration: 2020-11-30T06:16:20Z
Access Key Id: STS.NT7L6Jp5Y8W9LNvGQku2x****
Access Key Secret: 4nU8F6rv8MCDR8tygMDnXvN9yCNBCVrxnqArj1n1****
Security Token: CAIS/gF1q6Ft5B2yfSjIr5e****+nep4j5XSTmjHo1E+eb1Ujo7xijz2IH9IeXhpB****/43nWlU7PkYlrloRoReREvCKM1565kSqFn6O11Qf****+5qsoasPETOITyZtZagToeUZdfZfejXGDKgvyRvwLz****/Vli+S/OggoJmadJlNWvRL0AxZrFsKxBltdUROF****+pKWSKuGfLC1dysQcO4gEWq4bHm5zAs0OH1QOhlrVP+N+qfqLJNZc8YM1NNP6ux/Fze6b71ypd1gNH7q8ejtYfpmua74jBXgUAuU3faraOrYd1SwZ9Z7knH****/n6ifBjpvw9Hlk0R9OcVhqAAXpZx****+STGa8vctRwyTWdMM5LByes3cr1D46jaj0****/lTMkoXCwjMlCs7sc+DA9xjJCcl57eKC7A3ThnJAWQyyeKZfIGgeHN7yUS5ND8r7TBn6bMUqwvfVX****/cbkzBX6iV6jrataHZPZdtQYHH6GgvQ5XZUZJjoD****
Your SigninToken is: 06ec409b9d8c48f6ac5dcd18a0513ee1dhUkhcRn5CMsDqffC4wxsuFt9xjYtYePmYTHEWSMVKLFyXXnSq3IUbon1v46wCmKPwrAejDvw2i8rilolPSuxpKRDxz****
Your PageUrl is : http://signin.aliyun.com/federation?Action=Login&LoginUrl=https%3A%2F%2Fsignin.aliyun.com%2Flogin.htm&Destination=https%3A%2F%2Fdms.aliyun.com&SigninToken=06ec409b9d8c48f6ac5dcd18a0513ee1dhUkhcRn5CMsDqffC4wxsuFt9xjYtYePmYTHEWSMVKLFyXXnSq3IUbon1v46wCmKPwrAejDvw2i8rilolPSuxpKRDxzD****

The following example shows the format of the logon-free access URL (PageUrl):

http://signin.aliyun.com/federation?Action=Login
                            &LoginUrl=<your-redirect-url-on-expiration>
                            &Destination=<your-target-dms-url>
                            &SigninToken=<your-signin-token>
Note

The DMS page URL for the Destination parameter depends on the TicketType value.

  • If the value is normal, the corresponding DMS domain is http://dms.aliyun.com.

  • If the value is mini, it is typically used for BID virtual operators. The corresponding domain is http://dms-ent4service.aliyun.com.

Next steps

Open the logon-free access URL (PageUrl) to access the DMS console. Once logged on, the user identity appears in the upper-right corner of the DMS console in the format {RAM role name}/{RoleSessionName}, for example, aliyunlogintest/session-name-123.