Posts

Showing posts from May, 2023

Authentication Against SAP XSUAA from Local

Image
 Sometimes, we need to run SAPUI5 applications in the local desktop, and test it base on the remote data from SAP BTP. At the same time, remote BTP data is protected by SAP XSUAA and configured IDP. To access the remote protected data, we need the token issued by IDP. After getting the token, we can attach it to the HTTP header for each data request. Request Token The simplest way to request a token is using postman. By selecting oAuth authentication and provide required information, such as clientid and clientsecret, postman is able to request a token for us. If ui5 tooling is used for local SAPUI5 development, the returned the token by postman can be put into the yaml configuration file. The token info will be sent to remote BTP along with OData requests. One of the drawbacks of this manual approach is we are unable to know whether the token is expired or not. Each issued toke is only valid for a certain period of time which is determined by XSUAA configuration. To overcome this,...

Run SAP App Router Locally

 This is a summary after testing SAP App Router locally. Running SAP App Router locally may be not necessary for most cases, thus this is to demonstrate the technical possibility. Actually there are some famous blogs about this topic, hence I don't want to repeat those basic steps again here. What I want to highlight here are issues I met during my test.  For basic setup steps you can search for relevant posts. BTP Service and App For my test, I followed this public tutorial to setup BTP apps and service in my trial account.  But one important point which is missed in the tutorial is additional settings for XSUAA service configuration. In order to do authentication from local app router against remote BTP XSUAA service, below configuration is necessary. Otherwise, we will get invalid call back during oAuth authentication flow. "oauth2-configuration": {         "redirect-uris": [             "https://approuter-product-list...