Skip to Content
3
Feb 20, 2020 at 08:45 AM

Logout and login again issue with UI5 application and App Router

1448 Views Last edit Feb 20, 2020 at 08:53 AM 2 rev

Hello Experts,

We have three applications deployed on SAP Cloud Platform Cloud Foundry. App Router, UI application(UI5) and service application(JAVA).

Below is simple application architecture.

Reproduce steps:

1. User login to application by App router. The home page of UI5 application is displayed successfully. All the data from backend java application are retrieved successfully. We can also get login user info in App router.

https://***-approuter-***.cfapps.eu10.hana.ondemand.com/

2. Click logout button to sign off

3. Login again with the App Router URL

https://***-approuter-***.cfapps.eu10.hana.ondemand.com/

The problem is we can open the home page of application without login again. But there is no login user info. If you refresh the page, user will be redirected to the login page of XSUAA service.

If I directly access the service url of java application by the following URL, I will be redirected to login page.

https://***-approuter-***.cfapps.eu10.hana.ondemand.com/backend/hello

I think the problem is the cache of UI5 application. But I do not know how to fix it. Could you give some suggestions?

xs-app.json configuration of app router

{
"welcomeFile": "frontend/",
"logout": {
"logoutEndpoint": "/logout",
"logoutPage": "/logout.html"
 },
"authenticationMethod": "route",
"routes": [
 {
"source": "^/backend/(.*)$",
"target": "$1",
"destination": "service",
"authenticationType": "xsuaa"
 },
 {
"source": "^/logout.html$",
"localDir": "resources",
"authenticationType": "none",
"cacheControl": "no-cache"
 },
 {
"source": "^/frontend/(.*)$",
"target": "$1",
"destination": "frontend",
"authenticationType": "xsuaa",
"cacheControl": "no-cache"
 }
 ]
}

Attachments

untitled.png (9.1 kB)