Results 1 to 3 of 3

Thread: QueryString parameters not honored when redirecting

  1. #1

    Default QueryString parameters not honored when redirecting

    When a redirect to switch domains is made, querystring parameters are not preserved.

    Here's my scenario:
    My application is connected to FB for user login/registration. Because of how the spring-social bean is configured, out of the box I only have one return_uri for both mobile and desktop; this means that when my app gets called back the interceptor handler kicks in and redirects to the correct site, the thing is that the code parameter is not added to the URL and thus I can't authenticate.

    I think this could be solved easily by modifying AbstractSiteUrlFactory.createSiteUrlInternal() like this:

    Code:
    	protected String createSiteUrlInternal(HttpServletRequest request, String serverName, String path) {
    		StringBuilder builder = new StringBuilder();
    		builder.append(request.getScheme()).append("://").append(serverName);
    		String optionalPort = optionalPort(request);
    		if (optionalPort != null) {
    			builder.append(optionalPort);
    		}
    		builder.append(path);
    		String queryString = request.getQueryString();
    		if( queryString != null ){
    			builder.append("?" + queryString);
    		}
    		return builder.toString();
    	}
    (Potentially we need to first unescape the querystring, as it is re-escaped afterwards in the calling method?)

    The thing is that it's really tricky to fix because I have to subclass several classes (the ones for Tablet, Mobile, "Normal") (or just put a new one first into the classpath).

    Thanks
    ab

  2. #2
    Join Date
    Nov 2010
    Posts
    175

    Default

    I've created a JIRA for this to investigate the issue. Thanks!
    Roy Clarkson
    Spring Mobile Projects Lead

  3. #3
    Join Date
    Nov 2010
    Posts
    175

    Default

    I've pushed a fix for MOBILE-69 which should resolve this issue. Thanks!
    Roy Clarkson
    Spring Mobile Projects Lead

Posting Permissions

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