【发布时间】:2016-08-18 23:02:11
【问题描述】:
我正在通过扩展 AuthenticatedWebSession 来管理身份验证
登录
@Override
protected boolean authenticate(String username, String password) {
return true/false some auth logic here;
}
退出
@Override
public void signOut() {
super.signOut();
this.getApplication().getSecuritySettings().getAuthenticationStrategy().remove();
this.getSessionStore().invalidate(RequestCycle.get().getRequest());
throw new RedirectToUrlException("some_url_that_does_not_require_auth", HttpServletResponse.SC_MOVED_TEMPORARILY);
}
还有我的页面配置
@AuthorizeInstantiation("ADMIN")
public class Home extends Base {
//Page stuff here
}
现在的问题是,如果我退出,我仍然可以访问经过身份验证的内容。通过单击后退按钮或将 url 粘贴到浏览器。我只能观看内容,当我点击某些内容时,它会将我重定向到非身份验证页面。
当退出会话 ID 更改并从 SecuritySettings 中删除会话时,无法弄清楚为什么它仍然显示身份验证内容。
【问题讨论】:
标签: wicket