Spring Social and Session Registry

312 views Asked by At

I had an session management api, to logout certain users and so on backed by SessionRegistry, but now I have added Spring Social functionality and integrate it with current users. Unfortunately, using filter chain with SocialAuthenticationFilter do not integrate with Session Registry and I don't have information about sessions used by logged by OAuth users. Does anyone have an idea how to fix this or know better mechanism for logged users than SessionRegistry?

1

There are 1 answers

0
Matteo Codogno On

I had the same problem and I solved it by adding the SocialUserDetails to the SessionRegistry.

So in my SocialUserDetailsService when I build (loadUserByUserId) the SocialUserDetails I do that:

this.sessionRegistry.registerNewSession(UUID.randomUUID().toString(), frontendUser);