注销功能在使用 XSUAA 的 SAP Cloud Foundry 身份验证中无法正常工作

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

我正在尝试使用 XSUAA 实施身份验证。我可以使用我的 SAP CF 凭据登录并且登录工作正常。问题出在注销上。

当我尝试注销时,它被重定向到注销页面,但会话没有被清除。注销后,当我尝试点击 url,而不是登录页面时,它会重定向到索引页面。

按照官方文档Authentication check with Node.js and AppRouter,还是无法解决这个问题

这些是我的配置文件。

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": "",
        "destination": "myapp",
        "authenticationType": "xsuaa",
        "csrfProtection": false

    }
]}

xs-security.json

{
  "xsappname": "nodeauthapp",
  "tenant-mode": "dedicated"
}

文件夹结构

SAP IAS 租户配置了 OpenID 连接。由于某种原因,注销功能不适用于 OpenID Connect,并且没有关于此的明确文档。一旦从 OpenID Connect 切换到 SAML,注销功能就可以正常工作了。这是一种变通方法,可能不是真正的解决方案。这是 SAP CF 的问题。他们必须解决它。

Blog 将帮助您配置 IAS 租户。

注意:注销也不适用于默认身份提供者。 IAS Tenant 不适用于试用帐户。