Redirect fails with Forms Authentication

P

Paul

Geezuz, I feel like a fool but I can't get this SIMPLE redirect out of
IIS to hit my login page. Here's the Web.Config code:

<authentication mode="Forms">

<forms name="AuthTicket" path="/" protection="All"
loginUrl="login.aspx" timeout="10">

<credentials passwordFormat="Clear">

<user name="Paul" password="xyz" />

</credentials>

</forms>
</authentication>
<identity impersonate="false"/>



As you can see this is pretty simple stuff. I am in the IDE, I am using
localhost for the project, I start the project which immediately
requests a page with data on it, and I'm expecting that IIS will
redirect to the loginUrl. It doesn't. It blows it off.

My understanding is that any page I request from the root of this
project needs a request header with an authentication cookie or IIS will
automatically redirect to the loginUrl. That's all I know at this point.

Troubleshooting I did:

1. Misnamed some of the attributes in the above code and startup always
did read it and produce the correct exception. It reads the file.

2. Stopped and restarted IIS and aspnet_wp.

3. Rebooted.

How could this not work? Wow, I feel stupid tonight but it looks "OK"
to me.

~Paul
 
A

Arvind P Rangan

Paul,
Just try removing the path varibale in Froms tag.
As if u say "/" it will search under http://localhost/
but if your project is under a virtual directory or something then it will
create problems.
ARvind
 
P

Paul

Arvind, thanks for the response.

The path issue sounds like a good place to start but I haven't been able
to tweak it so that it makes any difference. The app folder is a web
share, of course, and it is definitely a virtual folder under IIS
Default Web Site.

In web.config:

I tried removing the path altogether.

I tried a path of "/myWebShare", and "myWebShare", and "\myWebShare".

Nothing works to trigger the redirect. Any further ideas will be
appreciated.

~Paul
 
P

Paul

Arvind, second note to you here. It appears (from a book I'm reading)
that the Path attribute only refers to the cookie path (its scope of
influence, so to speak.) If set to "/" then it handles sub-dirs as well
as the app root.

So, apparently it has nothing to do with triggering the redirect.

~Paul
 

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,983
Messages
2,570,187
Members
46,747
Latest member
jojoBizaroo

Latest Threads

Top