SAP-samples / cap-sflight

Using SAP Cloud Application Programming Model and SAP Fiori elements to build a simple travel management app, both with Node.js and Java.
https://cap.cloud.sap
Apache License 2.0
181 stars 127 forks source link

CF DEPLOYMENT NEVER WORKS #360

Open I501307 opened 1 year ago

I501307 commented 1 year ago

app gets deployed to cf but not at all in working conditon : {"statusCode":401,"code":"401","message":"Unauthorized"} can someone please share why am I getting this error?

gregorwolf commented 1 year ago

Please provide more details where exactly you get this error. Are you trying the NodeJS or Java variant?

srinikitha09 commented 1 year ago

Please provide more details where exactly you get this error. Are you trying the NodeJS or Java variant?

We used mbt tool for the deployment. When we try to click on the hyperlinks (Books, Authors etc.,) as shown in the image, it throws unauthorized error. image

gregorwolf commented 1 year ago

Have you assigned the Role Collection?

srinikitha09 commented 1 year ago

Have you assigned the Role Collection?

Thank you for the hint. Unfortunately, we do not have enough permissions on the level of subaccount to assign those role collections. We will try to deploy to another account and try in that way and will get back to you. Thank you :).

I501307 commented 1 year ago

This still doesn't work : {"statusCode":401,"code":"401","message":"Unauthorized"}

gregorwolf commented 1 year ago

Do you see any further error messages in the approuter / srv logs?

gregorwolf commented 1 year ago

Unfortunately you haven't provided detailed information what endpoint you're accessing. Seems that you try to access the srv endpoint directly. That does not work unless your browser would send a valit JWT token in the Authorization header as a Bearer token. You have to access the app via the HTML5 application that gets deployed to the managed approuter. I just did deploy this app to my BTP trial account and it works like a charm.

srinikitha09 commented 1 year ago

Unfortunately you haven't provided detailed information what endpoint you're accessing. Seems that you try to access the srv endpoint directly. That does not work unless your browser would send a valit JWT token in the Authorization header as a Bearer token. You have to access the app via the HTML5 application that gets deployed to the managed approuter. I just did deploy this app to my BTP trial account and it works like a charm.

Yes, you are right! We are trying to access the srv endpoint directly. But, when we try to access it via HTML5 application it is forcing us to subscribe to either of these services. Is it really needed to subscribe to these services to run or see something through HTML5 applications? image

gregorwolf commented 1 year ago

As this project doesn't provide a standalone approuter you have to subscribe to one of the mentioned services. The cheapest or even free one is the Launchpad Service. You might create a new issue in this project and suggest the addition of a standalone approuter.

I501307 commented 1 year ago

Unfortunately you haven't provided detailed information what endpoint you're accessing. Seems that you try to access the srv endpoint directly. That does not work unless your browser would send a valit JWT token in the Authorization header as a Bearer token. You have to access the app via the HTML5 application that gets deployed to the managed approuter. I just did deploy this app to my BTP trial account and it works like a charm.

Do we have any information or documentation on how to deploy to cf using the steps that you carried out ? Is there any project that works out of the box?

gregorwolf commented 8 months ago

Maybe we can also close this issue @I501307 ?