【发布时间】:2013-04-15 23:50:29
【问题描述】:
我正在开发一个基于 Grails 和 Vaadin 7 的应用程序。我设法让它们与 SpringSecurity 一起用于身份验证和授权,但我必须开发自己的服务来调用 Spring Security 身份验证管理器以使其与 Vaadin 一起使用:
class SecurityService {
static transactional = true
def springSecurityService
def authenticationManager
void signIn(String username, String password) {
try {
def authentication = new UsernamePasswordAuthenticationToken(username, password)
SCH.context.authentication = authenticationManager.authenticate(authentication)
} catch (BadCredentialsException e) {
throw new SecurityException("Invalid username/password")
}
}
}
问题是现在我需要实现remember me 身份验证,我不知道从哪里开始。
如何让authenticationManager 知道我希望它使用remeberMeAuthentication?我可以从登录视图上的复选框中获取布尔值,但接下来我该怎么做?
【问题讨论】:
标签: grails spring-security remember-me