RE: Checking IsAuthenticated for new ASP.NET session
From: Chris Rolon (ChrisRolon_at_discussions.microsoft.com)
Date: 01/23/05
- Next message: Sara Rafiee via .NET 247: "Help me! How I could make user in active directory"
- Previous message: Arne: "Re: Frontpage Server Extension a security problem?"
- In reply to: Richard: "Checking IsAuthenticated for new ASP.NET session"
- Next in thread: Richard: "Re: Checking IsAuthenticated for new ASP.NET session"
- Reply: Richard: "Re: Checking IsAuthenticated for new ASP.NET session"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Sun, 23 Jan 2005 08:01:02 -0800
In order to force authentication to occure you will have to disable the
anonymous user. The framework will verify that the user has been
authenticated and if not will redirect the user to the defined login page.
Here is a good sample:
http://samples.gotdotnet.com/quickstart/aspplus/default.aspx?url=/quickstart/aspplus/doc/formsauth.aspx
Chris Rolon
"Richard" wrote:
> How can I check to see if a user has previously been authenticated with
> FormsAuthentication on a page that is defined as viewable by everyone
> in web.config?
>
> For example, index.aspx and login.aspx allows everyone to see it via
> web.config entries:
> <authorization>
> <allow users="*" />
> </authorization>
>
> Then, when someone logs in I use forms authentication, and the user has
> the opportunity to keep the cookie/ticket persistent:
> FormsAuthentication.RedirectFromLoginPage(username, True)
>
> When the user closes out the session and returns to the website later,
> I would like to check if they had been previously authenticated using
> the index.aspx and login.aspx pages. Initially on those pages,
> Request.IsAuthenticated returns False, but if the user enters a
> restricted page, they are allowed to enter and Request.IsAuthenticated
> returns True from then on.
>
> Is this possible? Do I need to get into the cookie? If so, how?
> Thanks in advanced.
>
>
- Next message: Sara Rafiee via .NET 247: "Help me! How I could make user in active directory"
- Previous message: Arne: "Re: Frontpage Server Extension a security problem?"
- In reply to: Richard: "Checking IsAuthenticated for new ASP.NET session"
- Next in thread: Richard: "Re: Checking IsAuthenticated for new ASP.NET session"
- Reply: Richard: "Re: Checking IsAuthenticated for new ASP.NET session"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|