The goal is to provide a multi-customer application as a partner-managed application. To achieve it, you create consumer subaccounts for each customer in the SAP BTP global account of the partner that hosts the provider subaccount as well. Then, you subscribe to the multi-tenant SAP BTP application in the consumer subaccount and connect the customer ERP system and the corporate identity provider.
As a result of this setup, all customers use shared SAP BTP resources such as SAP BTP Cloud Foundry runtime and the SAP HANA Cloud service. At the same time, SAP BTP multitenancy ensures a clear and secure separation of customer data (by database schemas) and user access management.
To start the provisioning procedure, create an SAP BTP consumer subaccount for a specific customer:
- Open the SAP BTP cockpit (use the global account that hosts the provider subaccount of the SAP BTP application).
- Create a new Multi-Environment subaccount with the name
PoetrySlamsMTSubscriber1
(you can use any naming pattern for additional subaccounts to serve additional customers). - As a provider, choose Amazon Web Services (AWS).
-
In the newly created SAP BTP cockpit consumer subaccount, open Entitlements and assign SAP Build Work Zone with
- Service: SAP Build Work Zone, standard edition
- Plan: standard (Application).
-
Open the Service Marketplace and select the service SAP Build Work Zone.
-
Create a subscription of SAP Build Work Zone with
- Service: SAP Build Work Zone, standard edition
- Plan: standard (Application).
-
In the left navigation pane, open Security > Users and add the role collection Launchpad_Admin to your user.
Note: SAP Build Work Zone provides a managed application router that is used to manage application authentication and tokens.
The Partner Reference Application is a content provider and offers content using the common data model. Besides this, it creates destinations to access the provided content.
In the consumer subaccount, destinations for the design-time and the runtime of the provided content are required, too.
Therefore, export the required subaccount destinations from the provider subaccount and import them to the consumer subaccount.
-
Export the destinations from the provider subaccount.
- Open the SAP BTP cockpit of the provider.
- Navigate to the Destinations.
- Select the poetry-slams-cdm destination and export it. A file poetry-slams-cdm is stored on your computer.
- Select the poetry-slams-rt destination and export it. A file poetry-slams-rt is stored on your computer.
- Do not close the provider cockit as you still need it in the next steps.
-
Import the destinations in the consumer subaccount.
-
Open the SAP BTP cockpit of the consumer.
-
Navigate to the Destinations.
-
Import the poetry-slams-cdm destination using the downloaded file. The values of the destination are taken over. The value of the Client Secret property can't be exported but you can get it as follows:
- Navigate to Instances and Subscriptions of the provider subaccount.
- Select the poetry-slams-html5-runtime service instance in the table.
- Choose View Credentials at the top right corner of the screen.
- From the Credentials file that opens, copy the value of the clientsecret.
- Navigate back to your design-time destination and add the value you just copied to the Client Secret property.
-
Import the poetry-slams-rt destination using the downloaded file.
-
Replace the URL with
https://<consumer account subdomain>.launchpad.cfapps.eu12.hana.ondemand.com
.
Note: In case you undeploy the solution in the provider subaccount and deploy it again, the poetry-slams-cdm destination needs to be updated. The clientid, clientsecret and xsappname need to be copied from the poetry-slams-html5-runtime credentials.
-
Since the web application and the destinations for the provided content are available, it's ready to be added to SAP Build Work Zone.
This is done in the Site Manager that is launched when you go to the application SAP Build Work Zone, standard edition under Instances and Subscriptions in the consumer subaccount.
-
In the Site Manager, open the Channel Manager. As the web application is deployed in the provider subaccount, it is not automatically added as content to the HTML5 Apps content channel.
-
Create a new Content Provider.
- Set the title Poetry Slam Manager.
- Set the description Content of Poetry Slam Manager Solution.
- Select poetry-slams-cdm as Design-Time-Destination.
- Select poetry-slams-rt as Runtime-Destination.
- Save the content channel.
- Use Report to see the created elements of your channel.
Note: You must update the content channel every time you made changes to the web application. It may take some time to reflect the changes.
Note: For more information, refer to the SAP Help Creating a Content Provider.
- Open the Content Manager.
- The Poetry Slam Manager Role and the Poetry Slam Visitor Role were automatically created. The names in the ID fields are the name of the role collections that are created in the SAP BTP cockpit of the consumer account that handles the access for the application content.
- Select one of the roles.
- The Poetry Slams and the Visitors apps are automatically assigned. These were defined in the cdm-file of the application.
In this step, you create and review a launchpad site. If you already have a site, just add your web applications.
- Open the Site Directory.
- Create a site and enter a site name, for example, Partner Reference Application.
- Edit the newly created site.
- In the Assignments area on the right side of the screen, click into the search field. The Poetry Slam Manager Role should show up as a result.
- Choose the plus behind the Poetry Slam Manager Role.
- Choose the plus behind the Poetry Slam Visitor Role.
- Save the changes.
- To launch the site, open the URL provided in the Properties of the Site Settings. On the site, you can see no tiles yet. Before being able to see the Poetry Slams and Visitors tiles, you need to set up the authorizations.
Note: For quick access in the subsequent chapters of this tutorial, note down the URL.
If a customer needs to add further specific links to the site, follow these steps:
- Open the Content Manager.
- Create a new App and enter a description and the URL.
- Choose Open App - In a new tab.
- Deselect the Add intent and default SAP parameters to URL option.
- On the Navigation tab, enter Semantic Object
default
and Actiondefault
. - Create a new Group and enter a title and description.
- Add the new app to the group.
- Save your changes.
Now, assign the new app to the Everyone role, which is a default role. This makes the content visible to all users.
- Open the Content Manager.
- Choose Everyone to open the Role Editor.
- Choose Edit.
- On the Apps tab, find the list of available apps. Move the slider in the Assignment Status column to assign your apps to the group. The slider turns green.
- Save your changes.
Note: The added application should be visible on the site created in the previous step.
You use the Identity Authentication service as a corporate identity provider (IdP) and establish a trust relationship between the service provider (the SAP BTP subaccount to which you deployed the application) and the Identity Authentication service tenant. As a result, the SAP BTP subaccount and the application delegate user authentications to the Identity Authentication service tenant including single sign-on. Furthermore, you use the Identity Authentication service tenant to assign authorization roles to users through user groups.
However, as a prerequisite, you must have admin access to an Identity Authentication service tenant.
As a preferred approach, you configure trust between the SAP BTP subaccount and the Identity Authentication service using OpenID Connect (OIDC). As a further option, a SAML 2.0 trust configuration is described as well.
Set up the trust relationship between the SAP BTP subaccount to the Identity Authentication service using OpenID Connect (OIDC). For more information, refer to the SAP help about OpenID Connect.
Note: As a prerequisite for this setup, the SAP BTP subaccount and the Identity Authentication service tenant must be assigned to the same customer ID. If they are assigned to different customer IDs, configure SAML 2.0 as described below.
- Within your SAP BTP subaccount, open the menu item Security and go to Trust Configuration.
- Choose Establish Trust and select the Identity Authentication service tenant to set up the OIDC trust configuration.
- Log on to your Identity Authentication service Admin UI (URL: [IAS]/admin/).
- Open the menu item Applications and search for the application that refers to your SAP BTP subaccount.
Note that the name typically follows the pattern: XSUAA_[subaccount-name].
- Edit the application and change the following fields:
- The display name appears on the user log-on screen and the login applies to all applications linked to the Identity Authentication service tenant (following the single-sign-on principle). Change the Display Name to something meaningful from an end-user perspective representing the scope of the Identity Authentication service.
- Enter the Home URL, for example, the link to the SAP Build Work Zone launchpad or the application.
Set up the trust relationship between the SAP BTP subaccount to the Identity Authentication service using SAML 2.0. For more information, refer to the SAP help about SAP Cloud Identity Services. The SAML2 usage applies only if the OpenID Connect configuration is not possible. That is the case when the SAP BTP subscriber subaccount and the Identity Authentication service tenant are not assigned to the same customer ID. This setup comes with limitations regarding remote access to the OData services of the SAP BTP app with principal propagation.
-
In the SAP BTP consumer subaccount, download the SAML metadata file of the subaccount.
- Open Security in the menu and go to Trust Configuration.
- Choose Download SAML Metadata.
-
On the Identity Authentication admin UI, open Applications in the menu under Applications & Resources and create a new application of the type SAP BTP Solution:
- Enter the required information, such as application display name, home URL, and so on.
The display name appears on the user log-in screen and the login applies to all applications linked to the Identity Authentication service tenant (following the single sign-on principle). Choose a meaningful text from an end-user perspective representing the scope of the Identity Authentication service, for example,
Almika Inc. - Poetry Slams
, or something more general if you subscribed to multiple apps in your consumer subaccount. - Open the section SAML 2.0 Configuration and upload the subaccount SAML metadata file from the SAP BTP subaccount, which you downloaded in the previous step.
- Open the section Subject Name Identifier and select E-Mail as the primary attribute.
- Open the section Default Name ID Format and select E-Mail.
- Open the section Attributes and add the user attribute Groups with the value Groups from the source Identity Directory.
Note: The assertion attribute Groups is used to process authorization checks in the consumer subaccount based on user groups. The value Groups of the assertion attribute must be written with a capital G for SAP BTP subaccounts!
- Enter the required information, such as application display name, home URL, and so on.
The display name appears on the user log-in screen and the login applies to all applications linked to the Identity Authentication service tenant (following the single sign-on principle). Choose a meaningful text from an end-user perspective representing the scope of the Identity Authentication service, for example,
-
To download the SAML metadata file of the IdP, open the menu item Applications & Resources. Go to Tenant Settings and SAML 2.0 Configuration. Choose Download Metadata File.
-
In the SAP BTP consumer subaccount, open the menu item Security and go to Trust Configuration.
- Choose New SAML Trust Configuration.
- Upload the SAML metadata file of the IdP that you just downloaded and enter a meaningful name and description of the IdP (for example,
Corporate IdP
).
Looking for more information on the SAP Authorization and Trust Management service? Go to the Building Side-By-Side Extensions Using SAP BTP tutorial.
In this example, Identity Authentication service user groups are used to assign authorization roles to users. This comes with the advantage of customers assigning users to the groups in the IdP without requiring access to the SAP BTP subaccount. To achieve this, user groups are passed as an assertion attribute to the SAP BTP consumer subaccount and are mapped to the respective role collections in the subaccount.
-
On the Identity Authentication admin UI, open the menu item User Management under Users & Authorizations and add the users that require access to the SAP BTP application. Enter their user details such as name and e-mail address. However, take into account that the e-mail address is used as the identifying attribute (use the same e-mail address in all related systems incl. Identity Authentication service, ERP system, and so on).
-
Open the menu item Groups under Users & Authorizations and add user groups that represent typical user roles. Enter a unique (technical) Name and a meaningful Display Name, for example:
Name Display Name PoetrySlamManager
Poetry Slam Manager PoetrySlamVisitor
Poetry Slam Visitor Note: To add users to the user group, choose Add and select the user from the list of users and save your changes.
-
In the SAP BTP consumer subaccount, open the menu item Role Collections and edit the role collections that were created by SAP Build Work Zone, for example, ~poetry_slam_manager_poetrySlamManagerRole.
For each role collection, add the role from the reference application (defined in the xs-security.json) and add a user group by selecting the previously configured identity provider and set the name of the User Group (using the unique technical name of the user group of the Identity Authentication service).
Role Collection Role User Groups ~poetry_slam_manager_poetrySlamManagerRole
PoetrySlamManagerRole PoetrySlamManager
~poetry_slam_manager_poetrySlamVisitorRole
PoetrySlamVisitorRole PoetrySlamVisitor
There are two ways to test the application. Either using SAP Build Work Zone and the managed app router (preferred) or the subscription and the implemented app router.
Launch the SAP Build Work Zone site with the URL you noted down during the launchpad site creation. Set the Identity Authentication service tenant as IdP. Choose one of the tiles. The application should come up.
You may deactivate the user login with the Default Identity Provider (which refers to the SAP ID Service) in the Trust Configuration of your SAP BTP consumer subaccount. As a result, end users cannot select the Default Identity Provider, and the customer's Identity Authentication service tenant is used for authentication automatically.
Launch your SAP BTP application by navigating to Instances and Subscriptions and opening the SAP BTP application. Set the Identity Authentication service tenant as IdP.
Note: When opening the application through the subscription, only the poetry slams application can be tested. The navigation to the visitors application will not work as SAP Build Work Zone handles it.
Subscriptions can be deleted in the consumer subaccount, but be aware of the fact that all data will be lost. If you delete and recreate a subscription of the SAP BTP application, all consumer subaccount configurations (trust/SSO, destinations, and so on) remain valid, except for the user groups in the role collections. You may observe a 404 - Unauthorized error message when accessing the SAP BTP application if you haven't added the user groups to the role collections of the SAP BTP application after resubscribing to it.
If you manually delete an application or undeploy it from the provider subaccount while the application still has active subscriptions, note that there are a few service instances that can't be deleted. In addition, it's no longer possible to delete subscriptions to the removed application through the UI of the subscriber subaccounts. Instead, to delete the subscriptions, you need to access the service instance of the service SaaS Provisioning Service. Once you've removed all subscriptions, you can remove the remaining service instances from the provider subaccount.
If you need more information on how to trace and debug your application, go to the section on test and troubleshoot multitenancy.