Help Center > > SDK Reference> Getting Started with SDK> SDKs Related to SQL Jobs> Connecting to the DLI Server Using JDBC or ODBC> Performing Authentication

Performing Authentication

Updated at: Apr 09, 2019 GMT+08:00

Scenario

Before a user uses JDBC or ODBC to set up a DLI link, the user must be authenticated.

Procedure

Currently, the JDBC supports authentication using the Access Key/Secret Key (AK/SK) or token. The ODBC supports authentication using the AK/SK or public cloud account. You can log in to the ODBC as a public cloud account or IAM user in a similar way of logging in to the public cloud console.

  • (Recommended) Generating the AK/SK
    1. Log in to the DLI management console.
    2. Click the username in the upper right corner and select My Credential from the drop-down list.
    3. On the displayed My Credential page, click Access Keys. By default, the Project List page is displayed.
    4. Click Add Access Key. In the displayed Add Access Key dialog box, specify Login Password and SMS Verification Code.
    5. Click OK to download the certificate.
    6. After the certificate is downloaded, you can obtain the AK and SK information in the credentials file.
  • Obtain the token

    When using token authentication, you need to obtain the user token and configure the token information in the JDBC connection parameters. You can obtain the token as follows:

    1. Send POST https://<IAM_Endpoint>/v3/auth/tokens. To obtain the IAM endpoint and region name in the message body, see Regions and Endpoints.
      An example request message is as follows:
      NOTE:

      The italic items in the following example need to be replaced with the actual content. For details, see the Identity and Access Management API Reference.

      {
        "auth": {
          "identity": {
            "methods": [
              "password"
            ],
            "password": {
              "user": {
                "name": "username",
                "password": "password",
                "domain": {
                  "name": "domainname"
                }
              }
            }
          },
          "scope": {
            "project": {
              "id": "0aa253a31a2f4cfda30eaa073fee6477" //Assume that project_id is 0aa253a31a2f4cfda30eaa073fee6477.
            }
          }
        }
      }
    2. For details about how to obtain the token, see Obtaining a User Token in the Identity and Access Management API Reference. After the request is processed, the value of X-Subject-Token in the response header is the Token value.

Did you find this page helpful?

Submit successfully!

Thank you for your feedback. Your feedback helps make our documentation better.

Failed to submit the feedback. Please try again later.

Which of the following issues have you encountered?







Please complete at least one feedback item.

Content most length 200 character

Content is empty.

OK Cancel