2013-07-01 27 views
2

我正在使用WSO2 Identity Server 4.1.0執行基本身份驗證。可以調用AuthenticationAdmin webservice,它包含一個'loginWithRememberMeOption'。然後用戶將獲得一個'rememberMeCookie',即使他的會話(JSESSION)已經過期,他也可以登錄。WSO2:如何註銷已獲得'rememberMeCookie'的用戶

我已經瞭解到,loginWithRememberMeOption也有一個超時:7天,這一次不能被修改:WSO2 Authentication, adding/modifing timeout to the RememberMe cookie

的AuthenticationAdmin服務還提供了一個「退出」操作。不幸的是,這個操作只會使會話無效。所以如果用戶有一個記憶MeCookie,他仍然可以登錄:WSO2 AuthenticationAdmin Logout

問題是,如何註銷已獲得rememeberMeCookie的用戶?最好使用AuthenticationAdmin?

回答

0

據我所知,沒有直接的方式來註銷一個記住我的cookie的用戶。

我經歷了代碼。一旦您記住我的選項登錄,將生成一個UUID。請參考org.wso2.carbon.core.services.authentication.AuthenticationAdmin.loginWithRememberMeOption(String, String, String)方法AuthenticationAdmin

然後將cookie保存到數據庫中。當您以記住我cookie的身份登錄時,會從用戶存儲中檢查cookie。請參閱org.wso2.carbon.user.api.UserStoreManager.isValidRememberMeToken(String, String)。你可以檢查JDBC implementation

因此,爲了註銷,您可能必須清除用戶存儲區中的cookie。

如果您認爲可能有用添加方法來清除cookie,請報告JIRA問題。