cancel
Showing results for 
Search instead for 
Did you mean: 

BTP req.authInfo is blank

anandmuthu
Participant
0 Kudos

Hi Experts,

I have build a cds service based on the examples provided by SAP in Techbytes and opencloud 2020 tutorials. The only difference between the examples and my solution is that I am using a managed approuter. I have bootstrapped the express as per the tutorial and its working as per expected. Any odata and rest api calls are directing properly with xsuaa authentication done. 

As part of the custom validation api, I want to use the checkScopes functionality using req.authInfo.checkScopes. I have also tried req.user.is() as well. Any req.user or authInfo are blank. i found a few community answers that suggested req._.user but these are blank as well.

Example followed.

https://github.com/SAP-samples/hana-opensap-cloud-2020/blob/main/srv/routes/admin.js

My server.js, routes and express.js file is uploaded here in github.

https://github.com/anandmuthu1978/ExampleSrv/tree/main

Hope somebody can shed some light into the matter. 

Thanks.

Anand Muthu

 

 

Accepted Solutions (0)

Answers (0)