【发布时间】:2014-10-13 17:23:28
【问题描述】:
我想为我的应用程序实现记住我的服务。我面临的主要问题是我正在使用自定义身份验证提供程序。它使用第三方应用程序进行身份验证。我无法直接访问他们的数据库。
我检查了这个Link,它告诉 UserDetailService 的实现对于 userauthenticxation 服务是强制性的。不幸的是,我无法做到这一点。
我也检查了这个Link,它说你也可以实现一个customRememberMeServices。但我不确定这是如何完成的。它只是传递一个请求和一个没有凭据的响应。
由于我的理解有限; spring 将用户名和密码存储在令牌中
base64(username + ":" + expirationTime + ":" +
md5Hex(username + ":" + expirationTime + ":" password + ":" + key))
username: As identifiable to the UserDetailsService
password: That matches the one in the retrieved UserDetails
expirationTime: The date and time when the remember-me token expires,
expressed in milliseconds
key: A private key to prevent modification of the remember-me token
有没有办法从这个令牌中检索密码?如果不是,我还能如何达到同样的效果?
【问题讨论】:
标签: java spring authentication spring-security