在编译和群集服务器上退出securesocial的注销 [英] Getting logged out of securesocial on compile and on clustered servers

查看:79
本文介绍了在编译和群集服务器上退出securesocial的注销的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对认证机制本身有一个快速的问题. securesocial如何管理登录Cookie?我在系统中更改代码时遇到了一个小问题,并且在更改代码之前已经登录,然后我将注销,并且需要再次登录.这对于发展是正确的.对于生产,我们使用一个群集系统,该群集系统有2台计算机,如果我在一台计算机上启动一个请求,而下一个请求在另一台计算机上,那么我将每次注销.有谁知道这可能是什么,或者为什么会更好?我们正在使用securesocial 0.2.2

I have a quick question about the authentication mechanism itself. How does securesocial manages the login cookie? I have a little problem when I change code in my system and I have been logged in before the code change then I will be logged out and I need to login again. This is true for development. For production we use a cluster system which has 2 machines if i start a request on one machine and the next request is on the other machine then I will be logged out every single time. Does anyone has an idea what this could be or better why this happens ?? we are using securesocial 0.2.2

最诚挚的问候托马斯

推荐答案

该模块依靠UserService接口的实现来保存/查找经过身份验证的用户. SecureSocial带有默认实现:DefaultUserService.但是,这不适用于生产环境,因为它将所有内容存储在内存中的HashMap中.这就是为什么在DEV模式下重新加载应用程序时会退出登录的原因,或者要求您在集群环境中再次登录.

The module relies on an implementation of the UserService interface to save/find users that are authenticated. SecureSocial comes with a default implementation: DefaultUserService. However this is not suitable for a production environment because it stores everything in a HashMap in memory. This is why you get logged out when the app reloads on DEV mode or you are asked to log in again in a clustered environment.

您需要提供该类的自己的实现,并将其存储在DB或其他后备存储中.在UserService中检出javadocs.

You need to provide your own implementation of that class and store things in a DB or another backing store. Checkout the javadocs in UserService.

顺便说一句,请升级到0.2.4版.我修复了一个错误,该错误使应将某些请求重定向到登录页面时,该请求无法被授予访问权限.

BTW, please upgrade to version 0.2.4. I fixed a bug that prevented some requests to be granted access when they should be redirected to the login page.

这篇关于在编译和群集服务器上退出securesocial的注销的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆