Updated on 2023-12-22 GMT+08:00

AK/SK Signing and Authentication Process

The AK/SK signing and authentication process is as follows:

  1. API calling information is collected.

    The information to be collected includes:

    • Endpoint and URI that will constitute the request URL
    • AK/SK used for signing and authentication
    • Project ID and subproject ID
    • Account name and account ID
    • Domain name for Host
    Table 1 Required information to collect

    Item

    Description

    Endpoint

    Endpoint of a cloud service in a region.

    For details on how to obtain an endpoint, see Obtaining an Endpoint.

    URI

    API request path and parameters.

    Obtain the request path and parameters from the API Reference of the cloud service.

    AK/SK

    Access key ID (AK) and secret access key (SK), which are used to sign API requests.

    For details on how to obtain the AK/SK, see Obtaining an AK/SK.

    Project_Id

    Project ID, which needs to be configured for the URI of most APIs to identify different projects.

    For details on how to obtain a project ID, see Obtaining a Project ID.

    X-Project-Id

    Subproject ID, which is used in multi-project scenarios. To access resources in a subproject through AK/SK-based authentication, the X-Project-Id field must be added to the request header.

    For details on how to obtain a subproject ID, see Obtaining a Project ID.

    X-Domain-Id

    Account ID, which is used to:

    • Obtain a token for token authentication.
    • Call APIs of global services through AK/SK authentication. Global services (such as OBS and CDN) are deployed without specifying physical regions.

    For details on how to obtain the account ID, see Obtaining the Account Name and Account ID.

    Host

    Debugging domain name or independent domain name of the group to which the API belongs.

    For details, see the domain name information in the API group to which the API of each cloud service belongs.

  2. APIs are called.

    This document provides signature SDKs and API calling examples in multiple languages, such as Java, Go, Python, and C. You can find the language you need in Signing SDKs and Demo and integrate the SDK into your application by referring to the examples and API calling description.

    APIs can be called through IAM authentication or using AK/SK. For details, see How Do I Use a Temporary AK/SK to Sign Requests?.