I am working on a form based auth module for MS SQL reporting Services which is described here:
So far so good, but I run into this problem. The URL I call redirect to the login page to authenticate and then the page redirect back to the return url.
URL sample call:
http://thor/ReportServer/Pages/ReportViewer.aspx?%2fSampleUserReport&rs:Command=Render
This line crash:
FormsAuthentication.RedirectFromLoginPage(m_username, false);
Exception:
System.Web.HttpException: Der für die Umleitung von Anforderungen angegebene Rückgabe-URL ist ungültig.
bei System.Web.Security.FormsAuthentication.GetReturnUrl(Boolean useDefaultIfAbsent)
bei System.Web.Security.FormsAuthentication.GetRedirectUrl(String userName, Boolean createPersistentCookie)
bei TQsoft.Windows.Products.SSRS.Authentication.Logon.ServerBtnLogon_Click(Object sender, EventArgs e)
So after investigating and debugging I found out if I skip &rs:Command=Render
it works.
So the only special char in there I can imagine making problem is the :
char.
Any idea how to make it work since reporting services are working with those in the navigation a lot.
UPDATE
It turns out that I have to redirect myself like this:
Response.Redirect(Request.QueryString["ReturnUrl"].Replace(":","%3A"));
Context.ApplicationInstance.CompleteRequest();
But this throws another exception:
System.Threading.ThreadAbortException: Der Thread wurde abgebrochen.
bei System.Threading.Thread.AbortInternal()
bei System.Threading.Thread.Abort(Object stateInfo)
bei System.Web.HttpResponse.End()
bei System.Web.HttpResponse.Redirect(String url, Boolean endResponse)
bei System.Web.HttpResponse.Redirect(String url)
bei TQsoft.Windows.Products.SSRS.Authentication.Logon.ServerBtnLogon_Click(Object sender, EventArgs e)
I am really a rookie on asp.net, but start to hate it while RoR wins atm to me.
I had this issue before but with hebrew char that I wanted to pass using URL link.
Try to convert the char using %3A
.
Edit
I use Google translate to convert those chars: just write the chars/String, hit translate and copy the relevant part in the URL.