• SAP HANA

saphana
  1. Help Center
  2. SAP HANA
  3. User Guide (API)
  4. API Usage Guidelines
  5. AK/SK Authentication
  6. Request Signing Procedure

Request Signing Procedure

Preparations

  1. Download the API Gateway signing tool from the following link:

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

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

Sign a Request

  1. Create a request com.cloud.sdk.DefaultRequest (JAVA) used for signing.
  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 signing tool.
    2. Call Signer.sign(Request<?> request, Credentials credentials) to sign the request created in step 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 can be used to make an API call 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.

    For details, see descriptions of AccessServiceImpl.java in Sample Code.