Help Center/ Object Storage Service/ SDK Reference/ C/ Temporarily Authorized Request/ What Is a Temporarily Authorized Request
Updated on 2023-03-21 GMT+08:00

What Is a Temporarily Authorized Request

If you have any questions during development, post them on the Issues page of GitHub.

A temporarily authorized request is a URL temporarily authorized by specifying the AK and SK, request method, and related parameters. This URL contains authentication information and therefore you can use this URL to perform the specific operation in OBS. When the URL is being generated, you need to specify the validity period for it. The URL for temporarily authorized request is generated by setting the temp_auth_configure structure.

The temp_auth_configure structure exists in the obs_options structure. This method is applicable to each C SDK API.

Parameter

Description

Structure in SDK

expires

Validity period of the generated temporary URL

obs_options. temp_auth_configure

temp_auth_callback

The callback function used to return the generated temporary URL

callback_data

Callback data

If a CORS or signature mismatch error occurs, refer to the following steps to troubleshoot the issue:

  1. If CORS is not configured, you need to configure CORS rules on OBS Console. For details, see Configuring CORS.
  2. If the signatures do not match, check whether signature parameters are correct by referring to Authentication of Signature in a URL. For example, during an object upload, the backend uses Content-Type to calculate the signature and generate an authorized URL, but if Content-Type is not set or is set to an incorrect value when the frontend uses the authorized URL, a CORS error occurs. To avoid this issue, ensure that Content-Type fields at both the frontend and backend are kept consistent.