Logout functionality is not working properly in SAP Cloud Foundry authentication with XSUAA

1.4k Views Asked by At

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

enter image description here

1

There are 1 best solutions below

0
On BEST ANSWER

The SAP IAS Tenant was configured with OpenID connect. For some reason, logout functionality is not working with OpenID Connect and there is not clear document on this. Once switched from OpenID Connect to SAML, logout functionality is working fine. This is a work around and may not be an actual solution. It's an issue with SAP CF. They have to solve it.

This Blog will help you configure your IAS Tenant.

Note: Logout is not working with default identity provider too. And IAS Tenant is not available for trial accounts.