SAP Cloud Platform Connectivity policy template to generate & consume SCP OAuth token – Part 5
In this blog, we will consume the SAP cloud platform connectivity policy template available in the SAP API Business Hub. A policy template is basically a collection of policies and helps the reuse of policies built for a particular use case, thereby reducing time and effort.
We will see how the use-case described in Part 4 of the series can be achieved easily.
Copy policy template SAP Cloud Platform Connectivity to APIPortal:
- Open the Discover page in the APIPortal & search for the term ‘ connectivity’, select ‘ SAP Cloud Platform Connectivity ‘ in the results displayed.
- Navigate to the Artifacts tab, click on the Actions button associated with the Cloud Platform Connectivity policy template & select Copy.
- Policy template Cloud Platform Connectivity is copied to the API Portal, go to the Develop page & navigate to the Policy Template tab
Copy Data Quality Management API to APIPortal:
- Similarly, copy the Data Quality Management API to the APIPortal from the Discover page.
- In the upcoming dialog, enter suitable values as shown in below screenshot and after the API is copied, check the target endpoint URL with the production URL as done in the part3 of this series
- API ‘ mld ‘ is copied to APIPortal. Now open the API tab & deploy the copied API
Apply policy template Cloud Platform Connectivity on the Data Quality Management API:
- Now we have data quality API ‘ mld ‘ and policy template ‘ Cloud Platform Connectivity ‘
- Open the policy editor of the ‘ mld ‘ API in edit mode and click on Policy Template & click on Apply
- In the upcoming dialog, select the policy template & click on Apply
- Now the Cloud Platform Connectivity policy template is applied on our API
- In the GetCredentials policy, enter ClientID & ClientSecret as done in step 4 of the previous blog part4 of this series
GetCredential Code Snippet:
- In the GetOAuthToken policy update OAuth token endpoint URL as done in step 3 of the previous blog part4 this series
GetOAuthToken Code Snippet:
- Click on Update to update the policies and Save the API, now explore the API 🙂