SAP Home Learn Build Integrate Model Operate Extend with AI ConnectTutorial navigator Knowledge Graph API Devtoberfest Developer Advocates App Space

Manage my Account SAP Devs YouTube ↗ Learnings ↗ Community ↗ Provide Feedback ↗
Logout
β€’ Open full site

Secure a Basic Node.js App with the Authorization and Trust Management Service (XSUAA)

Secure a basic single-tenant Node.js application with the Authorization and Trust Management Service (XSUAA).

Overview

🎓 intermediate 50 min. SecurityIntermediateNode JsSAP Business Technology Platform

You will learn

  • βœ”How to secure a basic Node.js application with user authentication
  • βœ”How to secure a certain part of your application with user authorization
  • βœ”How to assign authorizations (in the form of a role collection) to a user
Michael Shea M Michael Shea September 1, 2025
Created by July 14, 2023
Contributors

Prerequisites

Prerequisites

  • Download the product list application from this repository or clone the branch sap-tutorial-xsuaa.

Steps

Intro

The goal of this tutorial is to secure and deploy a product list application with authentication and authorization, so only authenticated users with the correct authorizations are able to see the products within the application. Users without the necessary authorizations are able to log in to the application, but do not see the products.

The base for this tutorial is a Node.js application that uses the express framework and SAPUI5 to display a list of products (see screenshot).

ui5 product list application
ui5 product list application

Step 1 XSUAA and the Application Router
β€”

To secure this product list application, two components are used. One is called the XSUAA service and the other one is called application router. The application router is used in combination with the XSUAA service to authenticate a user and route the user to the secured application.

The XSUAA plays the role of an OAuth authorization service whereas the application router plays the role of an OAuth client. Furthermore, the application router works as a central entry point to the application. For more information, check the links at the end of this tutorial.


Step 2 Prepare the application files
+
Step 3 Prepare the application security descriptor
+
Step 4 Prepare the approuter files
+
Step 5 Move static content to the application router
+
Step 6 Update the manifest file
+
Step 7 Update the index.html file
+
Step 8 Create the XSUAA service instance
+
Step 9 Call your application from its secure route
+
Step 10 Assign the role collection
+
Step 11 Troubleshooting
+

Resources

Discussion

Share feedback on this tutorial or join the conversation in SAP Community.

Submit detailed feedback Discuss in Community
Steps
Step 1 of 12
1. XSUAA and the Application Router 2. Prepare the application files 3. Prepare the application security descriptor 4. Prepare the approuter files 5. Move static content to the application router 6. Update the manifest file 7. Update the index.html file 8. Create the XSUAA service instance 9. Call your application from its secure route 10. Assign the role collection 11. Troubleshooting 12. Resources

Learn more →