Announcement Announcement Module
No announcement yet.
Make ConnectController#redirectToProviderConnect() configurable Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Make ConnectController#redirectToProviderConnect() configurable

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

    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 and I'm trying to connect to Facebook, redirectToProvider() will redirect to 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:
    When you allow the app to have access to your Facebook account, it will redirect back to which doesn't exist. The right path is

    This problem is similar to the following post

  • #2
    Sounds like an oversight on our part. Would you mind opening a JIRA at We need to take into account the servlet path in our redirect URL generation.


    • #3
      Keith, I have filed a JIRA for this issue:

      Servlet path must be configurable in the redirect URL generation of ConnectController


      • #4
        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!


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


          • #6
            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
              Answering my own question