Implementation for Implicit social signup in spring-boot project
<p>By adding the spring-social signin / signup to my current spring-boot project, through the implementation of the classes <code>ConnectionSignUp</code> and <code>SignInAdapter</code>, the application, after the authorization with the social network website, it's requiring the implementation of a mapping for "/signup" in my controller. In this method, I do basically the same what I already have implemented on the ConectionSignUp method. Anyone knows what I can do to avoid this duplicity, and direct the application to my <code>ConnectionSignUp</code> class instead of one extra method on my controller?</p>

<p>my implementation so far includes the following classes:</p>

<p><strong>ConnectionSIgnUp</strong></p>

<pre><code>@Component
public class CustomConnectionSignUp implements ConnectionSignUp {
  @Autowired
  private UsuarioDao account;

  @Autowired
  private JavaMailSender mailSender;

  public String execute(Connection&lt;?&gt; connection) {
    UserProfile profile = connection.fetchUserProfile();

    String user;
    try {
      Usuario novo = new Usuario(profile.getUsername(),UUID.randomUUID().toString().replaceAll("-", ""),null,null,false,true);
      account.insert(novo);
      return novo.getLogin();
    } catch (Exception e) {
      return null;
    }
  }
}
</code></pre>

<p><strong>SignInAdapter</strong></p>

<pre><code>@Component
public class CustomSignInAdapter implements SignInAdapter {
  @Autowired
  private SocialUserDetailsService socialUserDetailsService;

  public String signIn(String userId, Connection&lt;?&gt; connection, NativeWebRequest request) {
    SocialUserDetails user = socialUserDetailsService.loadUserByUserId(userId);
    if(user != null)
      SecurityContextHolder.getContext().setAuthentication(new UsernamePasswordAuthenticationToken(user.getUserId(), null, null));
    return null;
  }
}
</code></pre>

<p><strong>SocialUserDetailsService</strong></p>

<pre><code>@Service

    public class CustomSocialUserDetailsService implements SocialUserDetailsService {
      @Autowired
      private UsuarioDao account;

      public SocialUserDetails loadUserByUserId(String userId) {
        for(Usuario usuario : account.select())
          if(usuario.getLogin().equals(userId))
            return new SocialUser(usuario.getLogin(), usuario.getSenha(), usuario.isEnabled(), usuario.isAccountNonExpired(), usuario.isCredentialsNonExpired(), usuario.isAccountNonLocked(), usuario.getAuthorities());
        return null;
      }
    }
</code></pre>

<p><strong>application.properties</strong></p>

<pre><code># SPRING SOCIAL (SocialWebAutoConfiguration)
spring.social.auto-connection-views=false

# SPRING SOCIAL FACEBOOK (FacebookAutoConfiguration)
spring.social.facebook.app-id=...
spring.social.facebook.app-secret=...

# SPRING SOCIAL TWITTER (TwitterAutoConfiguration)
spring.social.twitter.app-id=...
spring.social.twitter.app-secret=...
</code></pre>