Implemented a simple UserIdSource, that stores the user in a cookie
[examples/facebook-app] / src / main / java / de / juplo / yourshouter / SocialConfig.java
index 5308709..2abcd42 100644 (file)
@@ -70,22 +70,25 @@ public class SocialConfig extends SocialConfigurerAdapter
   {
     InMemoryUsersConnectionRepository repository =
         new InMemoryUsersConnectionRepository(connectionFactoryLocator);
+    repository.setConnectionSignUp(new ProviderUserIdConnectionSignUp());
     return repository;
   }
 
   /**
-   * Configure a {@link UserIdSource}, that is equivalent to the one, that is
-   * created by Spring-Boot.
+   * Configure our new implementation of {@link UserIdSource}, that retrieves
+   * the current user from the {@link SecurityContext}.
    *
    * @return
    *     An instance of {@link AnonymousUserIdSource}.
    *
-   * @see {@link AnonymousUserIdSource}
+   * @see {@link SecurityContextUserIdSource}
+   * @see {@link SecurityContext}
+   * @see {@link UserCookieInterceptor}
    */
   @Override
   public UserIdSource getUserIdSource()
   {
-    return new AnonymousUserIdSource();
+    return new SecurityContextUserIdSource();
   }