Spring Social
  1. Spring Social
  2. SOCIAL-195

/connect controller path is not configurable

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      /connect is hardcoded.

        Activity

        Hide
        Keith Donald added a comment - - edited

        https://github.com/SpringSource/spring-social/blob/master/spring-social-web/src/main/java/org/springframework/social/connect/web/ConnectController.java
        see line 258 where getControllerPath is called
        and how "/connect" is hardcoded in getControllerPath
        I did this because I can no longer rely on relative redirects to the controller path since we have multiple path levels ... e.g:
        GET /connect/facebook
        DELETE /connect/facebook
        but also:
        DELETE /connect/facebook/125660
        so for the latter, if I did a relative redirect expecting to get back to the /connect path level, I'd be at the /connect/facebook level instead, which is wrong.
        so this problem is now fixed by doing context-relative redirects but unfortunately /connect is now hardcoded.
        which means if someone customizes the url to which this controller is mapped, the redirects break.

        Show
        Keith Donald added a comment - - edited https://github.com/SpringSource/spring-social/blob/master/spring-social-web/src/main/java/org/springframework/social/connect/web/ConnectController.java see line 258 where getControllerPath is called and how "/connect" is hardcoded in getControllerPath I did this because I can no longer rely on relative redirects to the controller path since we have multiple path levels ... e.g: GET /connect/facebook DELETE /connect/facebook but also: DELETE /connect/facebook/125660 so for the latter, if I did a relative redirect expecting to get back to the /connect path level, I'd be at the /connect/facebook level instead, which is wrong. so this problem is now fixed by doing context-relative redirects but unfortunately /connect is now hardcoded. which means if someone customizes the url to which this controller is mapped, the redirects break.
        Hide
        Craig Walls added a comment -

        Converted to an improvement story to enable the URL to be customized without interfering with the multiple path levels.

        Show
        Craig Walls added a comment - Converted to an improvement story to enable the URL to be customized without interfering with the multiple path levels.
        Hide
        David Fuelling added a comment -

        I would like to configure the @RequestMapping of ProviderSignInController and ConnectController. The defaults seem to be to "/connect" and "/signin", but I would like to use a different path (e.g., "/social/connect" or "/auth/connect"). My use-case is that my site has usernames URL's that utilize the first path location to represent a profile page for a particular user (e.g., http://www.example.com/username will resolve to a user profile page for the user with username of "username").

        As currently written, Spring Social collides with the username "connect" and "signin". It is preferable for me to choose a few reserved word-paths (like, "social" or "auth") and prohibit these as usernames, and and allow server-side flow functionality via these reserved URL's. In this way, I only need to reserve a few URL's. For example, the connect flow could travel through "http://www.example.com/auth/connect" which would leave the "connect" username available for use.

        All in all, my use-case is the preservation of username URL address space. Spring Social isn't the only plugin/addon that will require special path treatment.

        For more details concerning the background of this comment, see my original question here:
        http://forum.springsource.org/showthread.php?130495-Change-RequestMapping-URL-for-ProviderSignInController-and-ConnectController

        Show
        David Fuelling added a comment - I would like to configure the @RequestMapping of ProviderSignInController and ConnectController. The defaults seem to be to "/connect" and "/signin", but I would like to use a different path (e.g., "/social/connect" or "/auth/connect"). My use-case is that my site has usernames URL's that utilize the first path location to represent a profile page for a particular user (e.g., http://www.example.com/username will resolve to a user profile page for the user with username of "username"). As currently written, Spring Social collides with the username "connect" and "signin". It is preferable for me to choose a few reserved word-paths (like, "social" or "auth") and prohibit these as usernames, and and allow server-side flow functionality via these reserved URL's. In this way, I only need to reserve a few URL's. For example, the connect flow could travel through "http://www.example.com/auth/connect" which would leave the "connect" username available for use. All in all, my use-case is the preservation of username URL address space. Spring Social isn't the only plugin/addon that will require special path treatment. For more details concerning the background of this comment, see my original question here: http://forum.springsource.org/showthread.php?130495-Change-RequestMapping-URL-for-ProviderSignInController-and-ConnectController
        Hide
        Adib Saikali added a comment -

        Here is my use case. My application is partitioned into different modules each top level module owns a different part of the url for example my app has /portfolio /network ... etc

        /network contains all my apps social features and I want to have the spring social urls live under /network so /network/connect/providerId this keeps the url namespace partitioned correctly.

        Show
        Adib Saikali added a comment - Here is my use case. My application is partitioned into different modules each top level module owns a different part of the url for example my app has /portfolio /network ... etc /network contains all my apps social features and I want to have the spring social urls live under /network so /network/connect/providerId this keeps the url namespace partitioned correctly.

          People

          • Assignee:
            Unassigned
            Reporter:
            Keith Donald
          • Votes:
            4 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated: