Skip to Content
1
Apr 12, 2021 at 09:21 AM

SAP CAP service and no authorisation for public service on SAP BTP

1423 Views

Hi all,

I am trying to have a CAP service running on SAP BTP which would not require any authentication but so far I am not succeeding.

Basically I have 2 components running - an app router and a CAP service - the CAP service is using authentication type "xsuaa".

So what did I configure:

(1) I added a route to my app router for that specfic path with auth type "none":

"routes": [
    {
      "source": "^/api/v1/public/(.*)",
      "destination": "srv_api",
      "authenticationType": "none"
    },


(2) I added a requires on my CAP service ( although I shouldn't if I understood the doc correctly as by default the services are not protected ).

service XXX
@(requires: 'any')

The service works but one needs to be authenticated with SAP BTP to execute it - otherwise an 'Unauthorized" page is showing up.

I am calling an ODATA function but I assume this should not behave differently then normal ODATA queries.

What am I missing ?

Steven