cancel
Showing results for 
Search instead for 
Did you mean: 

CAP application gives 401 unauthorized error after deployment to cloud foundry

David21
Explorer
0 Kudos
374

Hello everyone,

I have created a Node.js CAP application(List report & Object page) using managed approuter and deployed it to cloud foundry. I have not added any kind of authentication in it, Package.json doesn't have an auth stanza in the requires section and this is what my xs-security file looks like :

auth.png

When I go into my dev space and start the 'app-srv', it takes me to the index page where all the services are. But when i click on any service it gives 401 unauthorized . The interesting thing is when i access the app from the HTML5 Applications tab i can view the List report page and it shows me all the data.

I am also having the same issue with an app that i created with standalone approuter, As those applications dont appear in the HTML5 repository the only way to access them is through the link in your dev space. And that gives the authorization error.

Any ideas why this is happening ?

View Entire Topic
MioYasutake
Active Contributor
0 Kudos

@David21 
When a CAP application is deployed to Cloud Foundry, it requires authentication by default. If you want to skip authentication, include the following configuration in package.json. Please note that this is for testing purpose only and not recommended for production.

 

 

  "cds": {
    "requires": {
      "auth": "mocked",
...