SAP-samples / cloud-cf-multitenant-Inventory-management

Developing a SaaS Multi-tenant application on SAP BTP, Cloud Foundry environment.
Apache License 2.0
14 stars 15 forks source link

Provider UI application url is not working #2

Open prathik457 opened 5 years ago

prathik457 commented 5 years ago

I am trying to do a multi-tenant sample proof of concept in SAP Cloud Platform(SCP) using this repository as a reference. I have encountered a couple of problems and I am not sure what is the problem here. After deploying the application in subaccount1(space: APS), I went ahead and subscribed the deployed application from subaccount2. I see that the deployed application URL is not working. It says the subaccount does not map to a valid identity zone. Screenshot attached. capture1

Also, If I access the subaccount2's URL, I get a login screen, but after login, I am getting the following error.: Internal Server Error in login/callback REST call

Here is mta.yaml

`ID: attempt3 _schema-version: '2.1' version: 0.0.1

modules:

resources:

Here is the config.json { "appId": "attempt3!t9256", "displayName": "Inventory Management HANA App", "description": "An app to manage your inventory which uses HANA DB with Column Discrimination", "category": "Provider XYZ", "appUrls": { "onSubscription": "https://-invbackend./callback/v1.0/tenants/{tenantId}" } }`

Here is the xs-security.json { "xsappname": "attempt3", "tenant-mode": "shared", "description": "Security profile of called application", "scopes": [{ "name": "$XSAPPNAME.Callback", "description": "With this scope set, the callbacks for tenant onboarding, offboarding and getDependencies can be called.", "grant-as-authority-to-apps": [ "$XSAPPNAME(application,sap-provisioning,tenant-onboarding)" ] }] }

Please note that if I make the tenant-mode as dedicated, I am able to log in through provider URL. Let me know if anything else is required. TIA

carolavaitl commented 5 years ago

Hi @prathik457 , the first issue with the mapping of subdomain to the indentity zone can be solved by adding a new route. It has to fetch the tenant host pattern (also for provider subaccount).

The second issue I was getting as well in my own project and this is how I could solve it: I unsubscribed the subaccounts and deleted xsuaa and saas service. Then I built and deployed the app again and created a new saas registry service. I think xsuaa and saas did not fit anymore.