login redirect stripes querystrings

This is the place to report bugs and get support. When posting in this forum, please always provide as much detail as possible.

Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum, do not report it as a bug.

This is the place to report bugs and get support

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.
Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum.
This thread is closed to new posts. You must sign in to post in the forums.
4/18/2012 7:25:44 PM
Gravatar
Total Posts 30
www.CSBA.org

Information Technologies, Resources and Services

California School Boards Association

login redirect stripes querystrings

I think this is a bug and I couldn't find any references to it on the site.

If you have a page that requires authentication and the url has querystring data in it, when the user is redirected to the login module/page the querystring is stripped away.

So far we have not found a way around this with out modifying code but I could have missed a setting or such somewhere.

 

Thanks

4/19/2012 7:32:20 AM
Gravatar
Total Posts 18439

Re: login redirect stripes querystrings

Hi,

In a custom feature you should not be passing extra query string params to the CMS page (ie the page in the menu, all CMS pages are served by /Default.aspx?pageid=x even though they use friendly urls that map to that real url). You should link to a supporting page in your feature to pass extra parameters. Module controls are supposed to play nice with other features on the page which means no module owns the cms page and also should not manipulate the url of the cms page with extra parameters. None of the included features do that, they all have supporting pages for things like that. 

In a supporting page you can control the redirect and pass whatever you need as the returnurl parameter for the login page.

Hope that helps,

Joe

4/19/2012 1:29:53 PM
Gravatar
Total Posts 30
www.CSBA.org

Information Technologies, Resources and Services

California School Boards Association

Re: login redirect stripes querystrings

If I am understanding you correctly I am passing to a sub page.

we do not pass info to default.aspx?... but to something like MyInfoPage.aspx?...

The redirection works for the MyinfoPage.aspx but strips the querystring data.

So for example if I allow someone to book mark www.MyDomain.com/MyInfoPage.aspx?u=1 and the MyInfoPage requires you to be logged in then we will loose the ?u=1 when redirected to the login page.

Ok, am I understanding you correctly? Or is there something I should be doing differently?

 

Thanks again,

Jeff

4/19/2012 1:58:21 PM
Gravatar
Total Posts 18439

Re: login redirect stripes querystrings

If MyInfoPage.aspx is a page you created using the mojoPortal UI then it is a CMS page and it is served by /Default.aspx?pageid=x as described in How mojoPortal Works. You should not pass extras parameters to CMS pages for the reasons I stated.

If it is an actual physical .aspx file that is a supporting page in your custom feature and linked from your module control then it is your own code redirecting to login and you would have full control over any parameters in the return url.

In CMS pages if the page is protected by roles and the user is not authenticated we redirect using the CMS page url as the return url and it does not have extra parameters expected, it uses the friendly url of the page defined in page settings but that friendly url actually points to /Default.aspx?pageid=x by url re-writing

Hope that helps,

Joe

4/19/2012 2:34:00 PM
Gravatar
Total Posts 18439

Re: login redirect stripes querystrings

Actually looking into the code I see we have a solution you can use by adding this to your user.config file and then touch web.config to make it reload settings:

<add key="UseRawUrlForCmsPageLoginRedirects" value="true" />

But my advice is don't build custom features that link back to the the CMS page friendly url with extra parameters, that is working against the grain of the system for the reasons previously mentioned and not what we do in any features we ship, link to supporting pages instead is what I recommend and what I do in all the features I create that need extra parameters for anything. Using this web.config setting is a workaround and using extra params with the friendly url of CMS pages may have other unintended side effects, so it is a your mileage may vary kind of thing if you use that.

Hope that helps,

Joe

4/19/2012 4:13:25 PM
Gravatar
Total Posts 30
www.CSBA.org

Information Technologies, Resources and Services

California School Boards Association

Re: login redirect stripes querystrings

Ok, I was just misunderstanding you. I understand the process by which the portal displays friendly urls. the issue is, in this case, its not really an option to create a friendly url for each display item as there are over 20k of them and we are using an ajax interface to view them.

We'll just changes they way we are thinking about this. We'll figure another way to get the info to the module.

 

Thanks,

 

Jeff

You must sign in to post in the forums. This thread is closed to new posts.