|
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.ConnectController
@Controller @RequestMapping(value="/connect") public class ConnectController
Generic UI controller for managing the account-to-service-provider connection flow.
Constructor Summary | |
---|---|
ConnectController(ConnectionFactoryLocator connectionFactoryLocator,
ConnectionRepository connectionRepository)
Constructs a ConnectController. |
Method Summary | |
---|---|
void |
addDisconnectInterceptor(DisconnectInterceptor<?> interceptor)
Adds a DisconnectInterceptor to receive callbacks during the disconnection process. |
void |
addInterceptor(ConnectInterceptor<?> interceptor)
Adds a ConnectInterceptor to receive callbacks during the connection process. |
org.springframework.web.servlet.view.RedirectView |
connect(java.lang.String providerId,
org.springframework.web.context.request.NativeWebRequest request)
Process a connect form submission by commencing the process of establishing a connection to the provider on behalf of the member. |
protected java.lang.String |
connectedView(java.lang.String providerId)
Returns the view name of a page to display for a provider when the user is connected to the provider. |
java.lang.String |
connectionStatus(org.springframework.web.context.request.NativeWebRequest request,
org.springframework.ui.Model model)
Render the status of connections across all providers to the user as HTML in their web browser. |
java.lang.String |
connectionStatus(java.lang.String providerId,
org.springframework.web.context.request.NativeWebRequest request,
org.springframework.ui.Model model)
Render the status of the connections to the service provider to the user as HTML in their web browser. |
protected org.springframework.web.servlet.view.RedirectView |
connectionStatusRedirect(java.lang.String providerId,
org.springframework.web.context.request.NativeWebRequest request)
Returns a RedirectView with the URL to redirect to after a connection is created or deleted. |
protected java.lang.String |
connectView()
Returns the view name of a general connection status page, typically displaying the user's connection status for all providers. |
protected java.lang.String |
connectView(java.lang.String providerId)
Returns the view name of a page to display for a provider when the user is not connected to the provider. |
org.springframework.web.servlet.view.RedirectView |
oauth1Callback(java.lang.String providerId,
org.springframework.web.context.request.NativeWebRequest request)
Process the authorization callback from an OAuth 1 service provider. |
org.springframework.web.servlet.view.RedirectView |
oauth2Callback(java.lang.String providerId,
org.springframework.web.context.request.NativeWebRequest request)
Process the authorization callback from an OAuth 2 service provider. |
org.springframework.web.servlet.view.RedirectView |
oauth2ErrorCallback(java.lang.String providerId,
java.lang.String error,
java.lang.String errorDescription,
java.lang.String errorUri,
org.springframework.web.context.request.NativeWebRequest request)
Process an error callback from an OAuth 2 authorization as described at http://tools.ietf.org/html/rfc6749#section-4.1.2.1. |
org.springframework.web.servlet.view.RedirectView |
removeConnection(java.lang.String providerId,
java.lang.String providerUserId,
org.springframework.web.context.request.NativeWebRequest request)
Remove a single provider connection associated with a user account. |
org.springframework.web.servlet.view.RedirectView |
removeConnections(java.lang.String providerId,
org.springframework.web.context.request.NativeWebRequest request)
Remove all provider connections for a user account. |
void |
setApplicationUrl(java.lang.String applicationUrl)
Configures the base secure URL for the application this controller is being used in e.g. |
void |
setConnectInterceptors(java.util.List<ConnectInterceptor<?>> interceptors)
Configure the list of connect interceptors that should receive callbacks during the connection process. |
void |
setDisconnectInterceptors(java.util.List<DisconnectInterceptor<?>> interceptors)
Configure the list of discconnect interceptors that should receive callbacks when connections are removed. |
void |
setInterceptors(java.util.List<ConnectInterceptor<?>> interceptors)
Deprecated. Use setConnectInterceptors(List) instead. |
void |
setViewPath(java.lang.String viewPath)
Sets the path to connection status views. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
@Inject public ConnectController(ConnectionFactoryLocator connectionFactoryLocator, ConnectionRepository connectionRepository)
connectionFactoryLocator
- the locator for ConnectionFactory
instances needed to establish connectionsconnectionRepository
- the current user's ConnectionRepository
needed to persist connections; must be a proxy to a request-scoped beanMethod Detail |
---|
@Deprecated public void setInterceptors(java.util.List<ConnectInterceptor<?>> interceptors)
setConnectInterceptors(List)
instead.
interceptors
- the connect interceptors to addpublic void setConnectInterceptors(java.util.List<ConnectInterceptor<?>> interceptors)
interceptors
- the connect interceptors to addpublic void setDisconnectInterceptors(java.util.List<DisconnectInterceptor<?>> interceptors)
interceptors
- the connect interceptors to addpublic 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 valuepublic void setViewPath(java.lang.String viewPath)
viewPath
- The path to connection status views.public void addInterceptor(ConnectInterceptor<?> interceptor)
interceptor
- the connect interceptor to addpublic void addDisconnectInterceptor(DisconnectInterceptor<?> interceptor)
interceptor
- the connect interceptor to add@RequestMapping(method=GET) public java.lang.String connectionStatus(org.springframework.web.context.request.NativeWebRequest request, org.springframework.ui.Model model)
@RequestMapping(value="/{providerId}", method=GET) public java.lang.String connectionStatus(@PathVariable java.lang.String providerId, org.springframework.web.context.request.NativeWebRequest request, org.springframework.ui.Model model)
@RequestMapping(value="/{providerId}", method=POST) public org.springframework.web.servlet.view.RedirectView connect(@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)
@RequestMapping(value="/{providerId}", method=GET, params="code") public org.springframework.web.servlet.view.RedirectView oauth2Callback(@PathVariable java.lang.String providerId, org.springframework.web.context.request.NativeWebRequest request)
@RequestMapping(value="/{providerId}", method=GET, params="error") public org.springframework.web.servlet.view.RedirectView oauth2ErrorCallback(@PathVariable java.lang.String providerId, @RequestParam(value="error") java.lang.String error, @RequestParam(value="error_description",required=false) java.lang.String errorDescription, @RequestParam(value="error_uri",required=false) java.lang.String errorUri, org.springframework.web.context.request.NativeWebRequest request)
@RequestMapping(value="/{providerId}", method=DELETE) public org.springframework.web.servlet.view.RedirectView removeConnections(@PathVariable java.lang.String providerId, org.springframework.web.context.request.NativeWebRequest request)
HiddenHttpMethodFilter
to be registered with the '_method' request parameter set to 'DELETE' to convert web browser POSTs to DELETE requests.
@RequestMapping(value="/{providerId}/{providerUserId}", method=DELETE) public org.springframework.web.servlet.view.RedirectView removeConnection(@PathVariable java.lang.String providerId, @PathVariable java.lang.String providerUserId, org.springframework.web.context.request.NativeWebRequest request)
HiddenHttpMethodFilter
to be registered with the '_method' request parameter set to 'DELETE' to convert web browser POSTs to DELETE requests.
protected java.lang.String connectView()
protected java.lang.String connectView(java.lang.String providerId)
providerId
- the ID of the provider to display the connection status for.protected java.lang.String connectedView(java.lang.String providerId)
providerId
- the ID of the provider to display the connection status for.protected org.springframework.web.servlet.view.RedirectView connectionStatusRedirect(java.lang.String providerId, org.springframework.web.context.request.NativeWebRequest request)
providerId
- the ID of the provider for which a connection was created or deleted.request
- the NativeWebRequest used to access the servlet path when constructing the redirect path.
|
Spring Social | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |