According to SAP CAP document adding multi tenancy is simple: https://cap.cloud.sap/docs/guides/multitenancy/
cds add multitenancy
Should already do the trick.
Ok first of all there is a bug in usage of ${org}
in mta.yaml. If your org contains a space it will fail creating a proper name!
If I build and deploy the changed app it seems running but if I try to start it shows me this:
SAP HANA XS Advanced
The login is redirected to:
https://authentication.us10.hana.ondemand.com/login
I would expect the login like this one:
https://accounts.sap.com/saml2/idp/sso
As it was before. So that the login is still possible with S-User.
I also assume that I don't have to subscribe (https://me.sap.com/notes/0002805361) the app in the subaccount I created it?
So what could be the reason that login changes that way if app switches from
tenant-mode: dedicated
to
tenant-mode: shared
Steps to repdoruce
You need SAP CAP setup: https://cap.cloud.sap/docs/get-started/jumpstartcds init bookshop --add sample
cd bookshop
cds add multitenancy
npm i --save
cds add approuter --for production
cds add hana --for production
cds add mta
npm update --package-lock-only
npm update --package-lock-only --prefix mtx/sidecar
mbt build -t gen --mtar mta.tar
cf deploy gen/mta.tar -f
what I see on the logs trying to open the app:
... "layer":"/Auth/OAuth2" ... "msg":"query does not exist for request url /app/index.html"
... "layer":"/Auth/OAuth2" ... "msg":"sending page with client-side redirect to https://authentication.us10.hana.ondemand.com/oauth/authorize?...
... "layer":"/Auth/OAuth2" ... x-forwarded-path header: undefined"
On the screen I get this page: https://authentication.us10.hana.ondemand.com/login
There is obviously somethign wrong with the routes but I have no idea what.
Direct odata call results in ''Unauthorized'' without asking for any password.