Keycloak连接注销TypeError:request.kauth.grant.unstore不是功能

时间:2019-08-20 10:52:04

标签: express keycloak

我正在尝试通过Express和Keycloak实现受保护的API。

我的代码如下:

app.use(`/${process.env.VERSION}`, keycloak.protect(), routes.SecuredRouter);
        app.use( keycloak.middleware( { logout: '/logout' } ));

调用注销端点时,会出现以下错误:

TypeError: request.kauth.grant.unstore is not a function
    at logout (D:\projects\csus-api\csus-api\node_modules\keycloak-connect\middleware\logout.js:26:27)
    at Layer.handle [as handle_request] (D:\projects\csus-api\csus-api\node_modules\express\lib\router\layer.js:95:5)
    at trim_prefix (D:\projects\csus-api\csus-api\node_modules\express\lib\router\index.js:317:13)
    at D:\projects\csus-api\csus-api\node_modules\express\lib\router\index.js:284:7
    at Function.process_params (D:\projects\csus-api\csus-api\node_modules\express\lib\router\index.js:335:12)
    at next (D:\projects\csus-api\csus-api\node_modules\express\lib\router\index.js:275:10)

谢谢

0 个答案:

没有答案