org.springframework.social.connect.signin.web
Class ProviderSignInUtils

java.lang.Object
  extended by org.springframework.social.connect.signin.web.ProviderSignInUtils

public class ProviderSignInUtils
extends java.lang.Object

Helper methods that support provider user sign-in scenarios.


Method Summary
static Connection<?> getConnection(WebRequest request)
          Get the connection to the provider user the client attempted to sign-in as.
static void handlePostSignUp(WebRequest request)
          Add the connection to the provider user the client attempted to sign-in with to the new local user's set of connections.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getConnection

public static Connection<?> getConnection(WebRequest request)
Get the connection to the provider user the client attempted to sign-in as. Using this connection you may fetch a provider user profile and use that to pre-populate a local user registration/signup form. You can also lookup the id of the provider and use that to display a provider-specific user-sign-in-attempt flash message e.g. "Your Facebook Account is not connected to a Local account. Please sign up." Returns null if no provider sign-in has been attempted for the current user session.

Parameters:
request - the current web request, used to extract sign-in attempt information from the current user session

handlePostSignUp

public static void handlePostSignUp(WebRequest request)
Add the connection to the provider user the client attempted to sign-in with to the new local user's set of connections. Should be called after signing-up a new user in the context of a provider sign-in attempt. In this context, the user did not yet have a local account but attempted to sign-in using one of his or her existing provider accounts. Ensures provider sign-in attempt session context is cleaned up. Does nothing if no provider sign-in was attempted for the current user session (is safe to call in that case).

Parameters:
request - the current web request, used to extract sign-in attempt information from the current user session