After you developed your application, this tutorial shows you how to deploy your application in a dedicated SAP BTP subaccount, representing an end-to-end provisioning process of a single-tenant partner application in a customer SAP BTP account.
-
Open a new terminal and log on to SAP BTP Cloud Foundry runtime:
- Run the command
cf login
. - Enter the SAP BTP Cloud Foundry runtime API of your environment (for example,
https://api.cf.eu10.hana.ondemand.com
). - Enter your development user and password.
- Select org of the SAP BTP provider subaccount for the application.
- Select the SAP BTP Cloud Foundry runtime space (app).
- Run the command
-
Run the command
npm install
to install the messaging npm packages. -
Run the command
npm run build
to build the project. The archive.mtar is added to the folder mta_archives. -
To deploy the application, run the command
npm run deploy
.
Looking for more details? Go to the SAP Cloud Application Programming Model documentation on how to deploy to SAP BTP Cloud Foundry runtime
- To test your application, navigate to HTML5 Applications in the SAP BTP cockpit and choose poetryslams.
- The application opens and the launchpad is displayed with one tile.
- As you have not yet set up any authorizations, the application will tell you that you're not authorized to use it when you click on the tile.
- Do the same for the visitors application.
Since the web application is now available as an HTML5 application, it's ready to be added to SAP Build Work Zone.
This is done in the Site Manager, which is launched when you go to the application SAP Build Work Zone, standard edition under Instances and Subscriptions in your SAP BTP subaccount.
-
In the Site Manager, open the Channel Manager. The HTML5 Apps content channel is created automatically, and all web applications that you deployed to the SAP BTP subaccount are automatically added as content to this content provider.
-
In the HTML5 Apps content channel, choose Update content to fetch any updates for your web application. The HTML5 Apps content channel now exposes the latest version of the web applications.
Note: You must update the content channel every time you made changes to the web application.
- Open the Content Manager.
- Go to the Content Explorer sheet.
- Select the content provider HTML5 Apps.
- To add your web applications to your content, choose Add.
- Open the Content Manager.
- Create a new group and enter a title and description.
- On the Apps tab, you see a list of available apps. Move the red slider in the Assignment Status column of your apps to assign your apps to the group. The color of the slider changes to green.
- Save your changes.
In this step, you assign your apps to the Everyone role, which is a default role. The content assigned to this role is visible to all users.
- Open the Content Manager.
- To open the Role Editor, choose Everyone.
- Choose Edit.
- On the Apps tab, you can see a list of available apps. Move the red slider in the Assignment Status column of your apps to assign your apps to the group. The color of the slider changes to green.
- Save your changes.
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.
- To launch the site, open the URL provided in the Properties of the Site Settings. On the site, you can see the Poetry Slams and Visitors tiles. Before being able to launch both applications, you need to set up the authorizations.
Note: For quick access in the subsequent chapters of this tutorial, note down the URL.
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 via 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 fallback 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 in the fallback 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. This approach is the fallback trust configuration if the OpenID Connect configuration is not possible.
Note: This fallback applies only if 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.
- Within your SAP BTP subaccount, open the menu item Security and go to Trust Configuration.
- To download the Service provider SAML metadata file, choose Download SAML Metadata.
- Log on to your Identity Authentication service Admin UI (URL: [IAS]/admin/).
- Open the menu item Applications and create a new application of the type SAP BTP solution:
- Enter the required information such as application display name, application URL, and so on. 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). Choose something meaningful from an end-user perspective representing the scope of the Identity Authentication service.
- Open the SAML 2.0 Configuration section and upload the Service provider SAML metadata file which you downloaded previously from the SAP BTP subaccount.
- Open the Subject Name Identifier section and select E-Mail as the primary attribute.
- Open the Default Name ID Format section and select E-Mail.
- Open the menu item Tenant Settings and go to SAML 2.0 Configuration.
- To download the IDP SAML metadata file, choose Download Metadata File.
- Within your SAP BTP subaccount, open the menu item Security and go to Trust Configuration.
- Choose New SAML Trust Configuration.
- Upload the IDP SAML metadata file and enter a meaningful name and description for the Identity Authentication service (for example,
Corporate IDP
orCustom IAS (SAML2.0)
).
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, you use Identity Authentication service user groups to assign authorizaton roles to users. The user groups will be passed as assertion attribute to the SAP BTP subaccount and will be mapped to the respective role collections in the SAP BTP subaccount.
-
On the Identity Authentication service Admin UI, open the menu item User Management and add the users that should have access to the SAP BTP application. Enter user details such as name and e-mail. But take into account that the e-mail is used as the identifying attribute. As a recommendation, use the e-mail address that is used in the ERP system that you'll integrate later.
-
Open the menu item Groups 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
-
Open the menu item Applications, open the application referring to the SAP BTP subaccount with your application, and navigate to Attributes.
-
Check if there is an attribute with the name Groups and value Groups. If not, add the attribute mapping accordingly (Name: Groups, Source: Identity Directory, Value: Groups).
Note: Capital letters are required to ensure a correct mapping.
-
Within your SAP BTP subaccount, open the menu item Role Collections. Add the user groups (using their unique technical name) to the role collections that you want to assign to the users of the respective user group:
Role Collection User Groups PoetrySlamManagerRoleCollection
PoetrySlamManager
PoetrySlamVisitorRoleCollection
PoetrySlamVisitor
Launch your SAP BTP application and select the Identity Authentication service tenant as IdP.
Note: If the user has not yet been replicated from the Identity Authentication service tenant to the SAP BTP subaccount, the first attempt to open the app may fail with an authorization error message (at the very latest, the replication is triggered and executed automatically at this point). The second login attempt to open the app will be successful.
You may deactivate the Default Identity Provider (which refers to the SAP ID Service) in the trust center of your SAP BTP subaccount.
Looking for more information on the functionality of Poetry Slam Manager, the sample application? Go to the guided tour.