• Data Ingestion Service

dis
  1. Help Center
  2. Data Ingestion Service
  3. API Reference
  4. Environmental Preparations
  5. Authenticating API Requests Using the AK/SK
  6. Request Signing Procedure

Request Signing Procedure

Preparations

  1. Download the API gateway signing tool from the following website:

    https://apig-demo.obs.eu-de.otc.t-systems.com/java/java-sdk-core.zip

  2. Decompress the package.
  3. Create a Java project, and reference the extracted JAR to the dependency path.

Signing a Request

  1. Create request com.cloud.sdk.DefaultRequest (JAVA) that will be signed.
  2. Set the target API URL, HTTPS method, and content of request com.cloud.sdk.DefaultRequest (JAVA).
  3. Sign request com.cloud.sdk.DefaultRequest (JAVA).
    1. Call SignerFactory.getSigner(String serviceName, String regionName) to obtain a sample generated by a signing tool.
    2. Call Signer.sign(Request<?> request, Credentials credentials) to sign the request created in 1.

      The following code shows the details.

      //Select an algorithm for request signing.
      Signer signer = SignerFactory.getSigner(serviceName, region);
      //Sign the request. The request will change after the signing.
      signer.sign(request, new BasicCredentials(this.ak, this.sk));
  4. Convert the request signed in the previous step to a new request that is suitable to be sent and copy the header of the signed request to the new request.

    For example, if Apache HttpClient is used, convert DefaultRequest to HttpRequestBase and copy the header of the signed DefaultRequest to HttpRequestBase.