Spring Social
  1. Spring Social
  2. SOCIAL-168

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

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Complete
    • Affects Version/s: 1.0.0.M3
    • Fix Version/s: 1.0.0.RC1
    • Component/s: None
    • Labels:
      None

      Description

      The servlet path needs to be configurable in the ConnectController's redirectToProviderConnect() method

      ConnectController.java
      private String redirectToProviderConnect(String providerId) {
      	return "redirect:/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:

      web.xml
       
      <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

        Activity

        Hide
        Craig Walls added a comment -

        A change has been made to do a relative redirect instead of an absolute redirect. This should address the problem without having to do any special configuration or override of redirectToProviderConnect().

        Show
        Craig Walls added a comment - A change has been made to do a relative redirect instead of an absolute redirect. This should address the problem without having to do any special configuration or override of redirectToProviderConnect().

          People

          • Assignee:
            Craig Walls
            Reporter:
            Mark Serrano
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: