Updated to SecureSocial 2.0.12, and now sessions are not saved.

I used SecureSocial 2.0.7, and Id implemented UserServicePlugin, and users could log in. I could stop and restart the server (or recompile or something else), and the users would remain on the system.

Since the upgrade to version 2.0.12, the registration session is not saved on the server reboot.

Ive added a debug log for each method in UserServicePlugin . The user is in the saved state at login. However, when the server restarts and I try to access the page as a previously registered user, I just see in the logs:

 [info] play - database [default] connected at jdbc:postgresql://localhost/xxxxxx [info] application - [securesocial] loaded templates plugin: sec.SecureSocialViews [info] play - Starting application default Akka system. [info] application - [securesocial] loaded user service: class sec.LoginUserService [info] application - [securesocial] loaded password hasher bcrypt [info] application - [securesocial] loaded identity provider: userpass [info] play - Application started (Dev) [debug] application - [securesocial] calling deleteExpiredTokens() [debug] application - deleteExpiredTokens [debug] application - [securesocial] anonymous user trying to access : '/supplier/requests' 

Any ideas? Interestingly, for some reason, it receives a login cookie until it reaches the verification of an existing registration session ...

I use username and password authentication.

+6
source share
1 answer

The way user information is stored in the session has been changed. Instead of using a session cookie, the module now uses a separate one. This cookie has an authenticator identifier. User information is now stored in the server-side implementation of AuthenticatorStore. The default implementation uses the replay cache, so re-authentication requires re-authentication. Data in the cache is cleared.

If you want users to log in after recompiling / rebooting, you can:

  • Create an AuthenticatorStore implementation that is saved.
  • Modify the ehcache.xml file to save to the file system (diskPersistent = "true").
+4
source

Source: https://habr.com/ru/post/945324/


All Articles