Advanced Forms Authentication

N

news.microsoft.com

I've got a web site with URLs like the following:

http://www.mysite.com/nnnn/webpage.aspx

where nnnn is a number which represents an ID, e.g.
http://www.mysite.com/1234/webpage.aspx.

I can easily decode the URL and retrieve the ID (which represents a specific
customer) and then rewrite the URL, removing the ID so that the page served
for the above example would be http://www.mysite.com/webpage.aspx. This
scheme makes it look like each customer has their own "directory" on the web
site, where it's actually one directory but parameterised by their ID.

The problem is that Forms Authentication seems to require a hard-coded login
page in the web.config file. But I need to be able to specify the login page
at runtime. So, for the above example, if the user isn't authenticated,
Forms Authentication should redirect to
http://www.mysite.com/1234/login.aspx, but if the ID were 9999 it should be
http://www.mysite.com/9999/login.aspx.

What's the easiest way to achieve this?

TIA

MikeS.
 
D

Dominick Baier

Hi,

you could write an http module (or application event handler) that checks
for a 401 and does the redirect to the right login page manually. EndRequest
would be a good place for that.
 

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

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,023
Latest member
websitedesig25

Latest Threads

Top