Friday, September 25, 2020

SAP API Management - Verify API Key

Scenario: You want to provide access to API using API Key.

Steps:

1. Add an instance of Verify API Key in Preflow for incoming request.




2. Modify the code as per requirement. In this case, we will expect API key as query parameter (name: apikey) 

 <!--Specify in the APIKey element where to look for the variable containing the api key--> 

<VerifyAPIKey async='true' continueOnError='false' enabled='true' 

xmlns='http://www.sap.com/apimgmt'>

<APIKey ref='request.queryparam.apikey'/>

</VerifyAPIKey>

3. Now, add this API to API Products. 

4. Access Developer Portal -> Manage -> Manage Users -> Registered Users ->  Add user name. This step is required to generate Application for that particular user.

5. Click on the Published Products -> Subscribe -> Create new Application

6. Under Workspace, you will be able to see the new application. Now if you click on the application, you will be able to see Application Secret and Application Key.

                                                                 



7. Now, you can test the API using Test Console tab of Developer Portal.


No comments:

Post a Comment