I'm trying to implement authentication using XSUAA. I can able login with my SAP CF credential and login is working fine. The problem is with logout.
When I try to logout, it gets redirect to the logout page but the session is not cleared. After logout when I try to hit the url, instead of login page, it's redirecting to the index page.
I followed the official document Authentication check with Node.js and AppRouter but still I'm unable to fix this issue.
These are my configuration files.
manifest.yml
applications:
- name: <app-name>
routes:
- route: <route>
buildpack: https://github.com/cloudfoundry/nodejs-buildpack
host: <host-name>
path: myapp
memory: 128M
env:
destinations: >
[
{
"name":"myapp",
"url":<url>,
"forwardAuthToken": true
}
]
services:
- xsuaa-service
xs-app.json
{
"welcomeFile": "/index.html",
"authenticationMethod": "route",
"logout":
{
"logoutEndpoint": "/my/logout",
"logoutPage": "/logout-page.html"
},
"routes": [
{
"source": "^/myapp/(.*)$",
"target": "$1",
"destination": "myapp",
"authenticationType": "xsuaa",
"csrfProtection": false
}
]}
xs-security.json
{
"xsappname": "nodeauthapp",
"tenant-mode": "dedicated"
}
Folder Structure