我正在使用 Grails 1.3.7。我有一个在身份验证期间UserDetails创建的自定义对象customUserDetailsService。我假设这个自定义UserDetails对象然后存储在会话中的某个地方。但是,我找不到如何检索它。
我以为SecurityContextHolder.getContext().getAuthentication().getDetails()会这样做,但返回类型的对象:org.springframework.security.web.authentication.WebAuthenticationDetails,而不是我的自定义 UserDetails。