cancel
Showing results for 
Search instead for 
Did you mean: 

Access Credit Store in CAP

Abhi105
Advisor
Advisor
0 Kudos

Hi All,

I have created a BTP Credential Store instance and a CAP application. Within my CAP application's cat-service.js file I have written an Action on which I would like to read the Credential Store password and utilize it for further processing. Could you help with the steps to fetch the Password from Credential Store within BTP CAP service.js file ?

Thanks

Abhinav

View Entire Topic
martinfrick
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi abhinav.jain01,
Feel free to check out our sample repo, which is using Credential Store as part of a CAP-based multitenant SaaS application. That should give you a good idea how to implement things. Just use the credentials from the service binding and you are good to go!

https://github.com/SAP-samples/btp-cf-cap-multitenant-susaas/blob/basic/srv/utils/automator.js#L78
https://github.com/SAP-samples/btp-cf-cap-multitenant-susaas/blob/basic/srv/utils/credStore.js

Furthermore, also the Credential Store SAP Help page contains a nice sample Node.js script, which we leveraged for our coding!

https://help.sap.com/docs/credential-store/sap-credential-store/credential-management-example-node-j...

Best,

Martin