Suppose I develop an API on the SAP API Portal and don’t want it to be called for free by anonymous users; in other words, the API can only be called if a consumer has a valid API key.
One of the API policies published through the SAP Cloud Platform standard can easily fulfill this requirement.
Open the API that you want to protect by calling it, click on the Policies hyperlink,
Verify API key = Verify API key = Verify API key = Verify API key
Create a new policy instance with stream set to Incoming Request:
Replace the ref default value for the APIKey TAB.
After the modification is successful, click API URL again, and an error message will pop up:
{"fault": {"faultstring":"Failed to resolve API Key variable request.header. APIKey"."detail": ("errorcode":"steps.oauth.v2. FailedToResolveAPIKey "}
Copy the code
For more of Jerry’s original articles, please follow the public account “Wang Zixi “: