|
Spring Social | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.social.connect.web.ProviderSignInController
@Controller @RequestMapping(value="/signin") public class ProviderSignInController
Spring MVC Controller for handling the provider user sign-in flow.
Constructor Summary | |
---|---|
ProviderSignInController(ConnectionFactoryLocator connectionFactoryLocator,
UsersConnectionRepository usersConnectionRepository,
SignInAdapter signInAdapter)
Creates a new provider sign-in controller. |
Method Summary | |
---|---|
org.springframework.web.servlet.view.RedirectView |
canceledAuthorizationCallback()
Process the authentication callback when neither the oauth_token or code parameter is given, likely indicating that the user denied authorization with the provider. |
org.springframework.web.servlet.view.RedirectView |
oauth1Callback(java.lang.String providerId,
org.springframework.web.context.request.NativeWebRequest request)
Process the authentication callback from an OAuth 1 service provider. |
org.springframework.web.servlet.view.RedirectView |
oauth2Callback(java.lang.String providerId,
java.lang.String code,
org.springframework.web.context.request.NativeWebRequest request)
Process the authentication callback from an OAuth 2 service provider. |
void |
setApplicationUrl(java.lang.String applicationUrl)
Configures the base secure URL for the application this controller is being used in e.g. |
void |
setPostSignInUrl(java.lang.String postSignInUrl)
Sets the default URL to redirect the user to after signing in using a provider. |
void |
setSignInUrl(java.lang.String signInUrl)
Sets the URL of the application's sign in page. |
void |
setSignUpUrl(java.lang.String signUpUrl)
Sets the URL to redirect the user to if no local user account can be mapped when signing in using a provider. |
org.springframework.web.servlet.view.RedirectView |
signIn(java.lang.String providerId,
org.springframework.web.context.request.NativeWebRequest request)
Process a sign-in form submission by commencing the process of establishing a connection to the provider on behalf of the user. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
@Inject public ProviderSignInController(ConnectionFactoryLocator connectionFactoryLocator, UsersConnectionRepository usersConnectionRepository, SignInAdapter signInAdapter)
connectionFactoryLocator
- the locator of connection factories
used to support provider sign-in.
Note: this reference should be a serializable proxy to a singleton-scoped target instance.
This is because ProviderSignInAttempt
are session-scoped objects that hold ConnectionFactoryLocator references.
If these references cannot be serialized, NotSerializableExceptions can occur at runtime.usersConnectionRepository
- the global store for service provider connections across all users.
Note: this reference should be a serializable proxy to a singleton-scoped target instance.signInAdapter
- handles user sign-inMethod Detail |
---|
public void setSignInUrl(java.lang.String signInUrl)
signInUrl
- the signIn URLpublic void setSignUpUrl(java.lang.String signUpUrl)
signUpUrl
- the signUp URLpublic void setPostSignInUrl(java.lang.String postSignInUrl)
postSignInUrl
- the postSignIn URLpublic void setApplicationUrl(java.lang.String applicationUrl)
https://myapp.com
. Defaults to null.
If specified, will be used to generate OAuth callback URLs.
If not specified, OAuth callback URLs are generated from web request info.
You may wish to set this property if requests into your application flow through a proxy to your application server.
In this case, the request URI may contain a scheme, host, and/or port value that points to an internal server not appropriate for an external callback URL.
If you have this problem, you can set this property to the base external URL for your application and it will be used to construct the callback URL instead.
applicationUrl
- the application URL value@RequestMapping(value="/{providerId}", method=POST) public org.springframework.web.servlet.view.RedirectView signIn(@PathVariable java.lang.String providerId, org.springframework.web.context.request.NativeWebRequest request)
@RequestMapping(value="/{providerId}", method=GET, params="oauth_token") public org.springframework.web.servlet.view.RedirectView oauth1Callback(@PathVariable java.lang.String providerId, org.springframework.web.context.request.NativeWebRequest request)
SignInAdapter.signIn(String, Connection, NativeWebRequest)
If not, redirects the user to a signup page to create a new account with ProviderSignInAttempt
context exposed in the HttpSession.
ProviderSignInAttempt
,
ProviderSignInUtils
@RequestMapping(value="/{providerId}", method=GET, params="code") public org.springframework.web.servlet.view.RedirectView oauth2Callback(@PathVariable java.lang.String providerId, @RequestParam(value="code") java.lang.String code, org.springframework.web.context.request.NativeWebRequest request)
SignInAdapter.signIn(String, Connection, NativeWebRequest)
.
If not, redirects the user to a signup page to create a new account with ProviderSignInAttempt
context exposed in the HttpSession.
ProviderSignInAttempt
,
ProviderSignInUtils
@RequestMapping(value="/{providerId}", method=GET) public org.springframework.web.servlet.view.RedirectView canceledAuthorizationCallback()
|
Spring Social | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |