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
ですか?ログインビューのチェックボックスからブール値を取得できますが、次にそれをどうすればよいですか?