Results 1 to 7 of 7

Thread: Make ConnectController#redirectToProviderConnect() configurable

  1. #1
    Join Date
    Dec 2010
    Posts
    315

    Default Make ConnectController#redirectToProviderConnect() configurable

    Currently (M3) ConnectController's redirectToProviderConnect() method is private:

    Code:
    private String redirectToProviderConnect(String providerId) {
    		return "redirect:/connect/" + providerId;
    	}
    The problem is we can't override or set a custom redirect URL. The default method implementation assumes that after the domain we have a URL with a request mapping to /connect/{providerId}.

    For example, if my domain is http://mydomain.com and I'm trying to connect to Facebook, redirectToProvider() will redirect to http://mydomain.com/connect/facebook. This will work if you have a RequestMapping that matches such. However if in your web.xml you declared a different URL hierarchy for DispatcherServlet , then you'll run to HTTP status 404.

    Assuming you have the following DispatcherServlet declaration:
    Code:
    <servlet-mapping>
    		<servlet-name>spring</servlet-name>
    		<url-pattern>/myapp/*</url-pattern>
    	</servlet-mapping>
    When you allow the app to have access to your Facebook account, it will redirect back to http://mydomain.com/connect/facebook which doesn't exist. The right path is http://mydomain.com/myapp/connect/facebook

    This problem is similar to the following post http://forum.springsource.org/showth...rl()-protected

  2. #2
    Join Date
    Aug 2004
    Location
    Melbourne, FL
    Posts
    2,794

    Default

    Sounds like an oversight on our part. Would you mind opening a JIRA at jira.springsource.org/browse/SOCIAL. We need to take into account the servlet path in our redirect URL generation.
    Keith Donald
    Core Spring Development Team

  3. #3
    Join Date
    Dec 2010
    Posts
    315

  4. #4
    Join Date
    Aug 2004
    Posts
    1,073

    Default

    A change has been applied to do a relative redirect instead of an absolute redirect. This should address this problem without requiring any special config or override of redirectToProvider(). Let me know if this works for you. Thanks!
    Craig Walls
    Spring Social Project Lead

  5. #5
    Join Date
    Dec 2010
    Posts
    315

    Default

    Tested with latest snapshot...and it works! Thanks for the update

  6. #6
    Join Date
    May 2011
    Posts
    15

    Default What should be the maven dependecy

    Can someone tell me what should be the maven dependency that points to the nightly build that has the above mentioned fix? In the sense what is the version number i will have to use in maven.

  7. #7
    Join Date
    May 2011
    Posts
    15

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •