2

我正在使用 WSO2 Identity Server 4.1.0 来执行基本身份验证。可以调用包含“loginWithRememberMeOption”的 AuthenticationAdmin Web 服务。然后,用户将获得一个“rememberMeCookie”,即使他的会话 (JSESSION) 已过期,他也可以使用它登录。

我了解到 loginWithRememberMeOption 也有超时:7 天,并且这个时间不能修改:WSO2 Authentication, added/modifing timeout to the RememberMe cookie

AuthenticationAdmin 服务还提供“注销”操作。不幸的是,此操作只会使会话无效。因此,如果用户有一个 rememeberMeCookie,他仍然可以登录:WSO2 AuthenticationAdmin Logout

问题是,我如何注销已获得 rememeberMeCookie 的用户?最好使用 AuthenticationAdmin?

4

1 回答 1

0

据我了解,没有直接的方法可以使用记住我的 cookie 注销用户。

我浏览了代码。使用记住我选项登录后,将UUID生成 a。AuthenticationAdmin中的引用org.wso2.carbon.core.services.authentication.AuthenticationAdmin.loginWithRememberMeOption(String, String, String)方法

然后将 cookie 保存在数据库中。当您使用记住我的 cookie 登录时,会从用户存储中检查 cookie。参考org.wso2.carbon.user.api.UserStoreManager.isValidRememberMeToken(String, String)。您可以检查JDBC 实现

因此,为了注销,您可能必须从用户存储中清除 cookie。

如果您认为添加清除 cookie 的方法可能有用,请报告JIRA问题。

于 2013-07-17T11:46:32.977 回答