Using Forms Authentication With URLRewrite

S

Summa

Hi,

In ASP.NET, i've written a class that handles URLRewrite. So that all
requests to say "default.aspx?id=2&basic=1" is returned as "basic.1/2.aspx".
It works beautifully...But but but....Using forms authentication the
authentification redirect somehow get redirected using the non-rewritten
url. That is....the redirect happens on the rewritten URL. Exampel:

I call "mysite.com/basic.1/2.aspx".
1. The URLRewrite rewrites the URL to "default.aspx?id=2&basic=1".
2. The Forms authentication kicks in and takes the rewritten URL as "calling
url".
3. After authentication I'm redirected back to "default.aspx?id=2&basic=1"
and not "mysite.com/basic.1/2.aspx".

Hope you understand my problem. Of course the system handles the urls, but
it looks odd. I need to be able to intercept the Forms authentication and
handle it the proper URL. Any ideas? Perhaps some event that I'm not
familiar with?
 
P

Paul Hatcher

Just a thought are you using Redirect or RewritePath on your modified url?

Paul
 
S

Summa

Hi,

Paul Hatcher said:
Just a thought are you using Redirect or RewritePath on your modified url?

Im using RewritePath....

I could, of course, somehow check to see if the user is authenticated and if
not: Just dont rewrite the URL. That would bring up the desired
behaviour...but its somehow not that elegant and I wanna keep all that logic
in the same Class (My Authenticator class). Perhaps from an event...?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top