spring-attic / spring-social

Allows you to connect your applications with SaaS providers such as Facebook and Twitter.
http://projects.spring.io/spring-social
Apache License 2.0
619 stars 351 forks source link

Adding connection not working #95

Closed sfussenegger closed 8 years ago

sfussenegger commented 11 years ago

Adding a connection for an already authenticated user fails for two reasons:

  1. Redirecting inside SocialAuthenticationFailureHandler won't work as onAuthenticationFailure(..) is called after clearing the SecurityContext, thus the user is logged out. Following the contract of attemptAuthentication(..) it should "Return null, indicating that the authentication process is still in progress"
  2. The principal used insied addConnection(..) is always null as the SocialAuthenticationToken is unauthenticated at this point (If authenticated it still wouldn't be of type ConnectionData though). Instead, token.getConnection() should be used directly.