Creating and Using a Signature Key
Scenario
Signature keys are used by backend services to verify the identity of API Gateway.
A signature key consists of a key and secret, and can be used only after being bound to an API. When an API bound with a signature key is called, API Gateway adds signature details to the API request. The backend service of the API signs the request in the same way, and verifies the identity of API Gateway by checking whether the signature is consistent with that in the Authorization header sent by API Gateway.
- You can create a maximum of 30 signature keys.
- An API can only be bound with one signature key in a given environment, but each signature key can be bound to multiple APIs.
Procedure
- Create a signature key on the API Gateway console.
- Bind the signature key to an API.
- API Gateway sends signed requests containing a signature in the Authorization header to the backend service. The backend service can use different programming languages (such as Java, Go, Python, JavaScript, C#, PHP, C++, C, and Android) to sign each request, and check whether the two signatures are consistent.
Creating a Signature Key
- Log in to the management console.
- Click in the upper left corner and choose API Gateway.
- In the navigation pane, choose API Publishing > Signature Keys.
- Click Create Signature Key.
- In the Create Signature Key dialog box, set the parameters listed in Table 1.
- Click OK.
Binding a Signature Key to an API
- In the navigation pane, choose API Publishing > Signature Keys.
- Bind a signature key to an API. You can use one of the following methods:
- In the Operation column of the signature key to be bound to an API, click Bind to API.
- Click the name of the target signature key.
- Click Select API.
- Specify an API group, environment, and API name keyword to search for the desired API.
- Select the API and click OK.
If a signature key is no longer needed for an API, unbind it from the API.
Verifying the Signing Result
Sign each backend request by following the instructions in chapter "Creating Signatures for Backend Requests" of the Developer Guide, and check whether the backend signature is consistent with the signature in the Authorization header of the API request.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot