Adding a connection for an already authenticated user fails for two reasons:
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"
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.
Adding a connection for an already authenticated user fails for two reasons: