After Form Authentication: IsAuthenticated and User Name

  • Thread starter Thread starter Johnnie Norsworthy
  • Start date Start date
J

Johnnie Norsworthy

ASP.NET 2.0

I can't seem to locate how to determine two simple things after I perform a
FormAuthentication.

From a subsequent page load, how do I determine if a user is authenticated
already?

If they are authenticated, what property do I read to find out their name?

Thanks - I looked all over the help file and a bunch of web sites, but I
could not find an answer to this for some reason.

-Johnnie
 
From a subsequent page load, how do I determine if a user is authenticated already?

You don't need to, it's handled automatically, of course you may want to do it
anyway in case the site is missconfigured accidently.

You can use Request.IsAuthenticated to check if the user is authenticated.
If they are authenticated, what property do I read to find out their name?

Page.User.Identity.Name

PL:
 
PL said:
You don't need to, it's handled automatically, of course you may want to
do it
anyway in case the site is missconfigured accidently.

You can use Request.IsAuthenticated to check if the user is authenticated.


Page.User.Identity.Name

Thanks. I'll give that a go.
 
Back
Top