cancel
Showing results for 
Search instead for 
Did you mean: 

How to consume SAP Graph API in SAP CAP Extension Project

Ranjith
Participant
332

Dear Team,

I'm trying to consume the SAP Graph HCM solution in my SAP CAP extension application.

To achieve the same, I have create the destination for SAP Graph (OAuth2JWTBearer) using Graph service client Id and Client secret details.

But, When I'm consuming the same in my SAP CAP Node.js using external API Consume approach, I'm getting "No Database connection" Issue.

BTP Subaccount Destination

Package.json Configuration:

Custom handler.js file:

Accepted Solutions (1)

Accepted Solutions (1)

marc_vornetran
Product and Topic Expert
Product and Topic Expert
0 Kudos

ranjith13119-gmail.com was able to solve the issue by doing the following things:

1. The error "No database connection" was happening because the custom handler was not invoked for the Graph entities and due to the missing "@cds.persistence.skip" annotation on the entities the CAP framework assumed it needs to query the database to fetch results.
2. The destination was changed to use "No authentication". Instead, the JWT for accessing the Graph API is forwarded to the destination in the "Authorization"-header as a bearer token.

Ranjith
Participant

Thanks for your help.

Answers (0)