Re: FormsAuthentication.RedirectFromLoginPage

From: Andy Sutorius (andy_at_sutorius.com)
Date: 02/16/05


Date: Wed, 16 Feb 2005 18:19:26 GMT

Bill,

Thanks for that. I forgot to put in an allow. This is what my web.config
looks like now. And I am still getting the same response. I am attempting to
control access into a subdirectory from the web.config in the root folder.
Any other ideas?

<location path="admin" allowOverride="false">
<!-- <location path="admin" allowOverride="true"> -->
<system.web>
<authorization>
<deny users="?" />
<allow users="*" />
</authorization>
</system.web>
</location>

"Bill Borg" <BillBorg@discussions.microsoft.com> wrote in message
news:2D435316-86B8-4AB5-9792-3110F7C1F9FF@microsoft.com...
> Steve, doesn't the redirectfromloginpage call create the cookie for you?
>
> Andy, I've also had this when my web.config is not set up correctly to
deny
> anonymous users and *allow* authenticated users.
>
> Bill
>
> "Steve C. Orr [MVP, MCSD]" wrote:
>
> > It looks like you've forgotten to call SetAuthCookie.
> > Here's more info:
> >
http://authors.aspalliance.com/aspxtreme/sys/Web/Security/FormsAuthenticationClassSetAuthCookie.aspx
> >
> > --
> > I hope this helps,
> > Steve C. Orr, MCSD, MVP
> > http://SteveOrr.net
> >
> >
> > "Andy Sutorius" <andy@sutorius.com> wrote in message
> > news:%sLQd.69593$dt3.7467733@twister.southeast.rr.com...
> > > Hi,
> > >
> > > For some reason the login.aspx webpage redirects to itself after a
> > > successful login and not to the url in the address bar. I have stepped
> > > through this with debug and it behaves as it is supposed to. What am I
> > > overlooking? Try it.
> > >
> > > http://www.sutorius.com/psyche
> > > click the Administration link
> > > username = user1
> > > password = user1
> > >
> > >
> > > private void cmdLogin_ServerClick(object sender, System.EventArgs e)
> > > {
> > > if (ValidateUser(txtUserName.Value,txtUserPass.Value) )
> > >
> > >
> > >
FormsAuthentication.RedirectFromLoginPage(txtUserName.Value,chkPersistCookie
> > > .Checked);
> > >
> > > else
> > >
> > > lblMsg.Text = "Invalid Log in";
> > >
> > >
> > >
> > >
> > >
> >
> >
> >



Relevant Pages