cancel
Showing results for 
Search instead for 
Did you mean: 

External API access cds view of tutorial of full-stack application

05-06-2021 4:02 PM
minjie_lao Product and Topic Expert
1316 views 3 comments Go to solution
0 Likes
SAP Managed Tags
Subscribe

Hi,

Finally, I get thru the full stack application tutorial against the latest tutorial (https://developers.sap.com/tutorials/hana-cloud-cap-add-authentication.html) by using business application studio.

Since the tutorial #6 is guiding to apply the xsuaa authentication to ensure the application secured.

Therefore, is there any updated tutorial of how the external API can be authorized to access the CDS view?

Thanks in advance,

Minjie

0 Likes

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate

Have a look at this blog post. It shows how to get the credentials for testing in Postman.

Using Postman for API Testing with XSUAA | SAP Blogs

minjie_lao
Product and Topic Expert
Product and Topic Expert
0 Likes

thank you Thomas,

Answers (1)

Answers (1)

pfefferf
Active Contributor
0 Likes

One option is to use a client credentials grant:

  • Create a new service key on the XSUAA instance bound to your service app. In the service key you can find the needed OAuth client id + secret for the next step.
  • Get an access token using by calling the OAuth endpoint. Details how to do the request can be found here. The endpoint you have to call can be found in the VCAP_SERVICES environment variable (under the XSUAA credentials object property). To be able to show that information, e.g. navigate to the service application in the SAP BTP cockpit and check the env. variables in the Environment Variables section.