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

问题描述

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

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

我遵循了官方文档 Authentication check with Node.jsAppRouter,但仍然无法解决此问题。

这些是我的配置文件。

ma​​nifest.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"
}

文件夹结构

enter image description here

解决方法

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

Blog 将帮助您配置 IAS 租户。

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

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...