re:
And can you tell me which code line should I use to verify if a user is authenticated:
Request.IsAuthe nticated.ToStri ng, My.User.IsAuthe nticated.ToStri ng or
User.Identity.I sAuthenticated. ToString?
Which ones return valid responses ?
You can use any which return valid responses.
Remember, they will only produce valid results if you're using Forms Authentication and Membership.
They will *not* authenticate a user if you're using Windows Integrated Security.
Juan T. Llibre, asp.net MVP
asp.net faq :
http://asp.net.do/faq/
foros de asp.net, en español :
http://asp.net.do/foros/
=============== =============== =====
"shapper" <md*****@gmail. comwrote in message
news:11******** **************@ 16g2000cwy.goog legroups.com...
Hi Juan,
It is working now. Could you tell me if this is the right way:
If Membership.Vali dateUser("usern ame", "pass") Then
FormsAuthentica tion.SetAuthCoo kie("shapper", True)
Response.Write( Request.IsAuthe nticated.ToStri ng)
Response.Write( My.User.IsAuthe nticated.ToStri ng)
Response.Write( User.Identity.I sAuthenticated. ToString)
Else
Response.Write( "# User is Not Authenticated #")
End If
And can you tell me which code line should I use to verify if a user is
authenticated:
Request.IsAuthe nticated.ToStri ng, My.User.IsAuthe nticated.ToStri ng or
User.Identity.I sAuthenticated. ToString?
Thank You,
Miguel
Juan T. Llibre wrote:
I have already explained to you that Authentication is not the same as validating Membership.
You will *always* get False when validating Membership data
against Authenticated users, who must login with Windows credentials.
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
=============== =============== =====
"shapper" <md*****@gmail. comwrote in message
news:11******** **************@ f1g2000cwa.goog legroups.com...
Hello,
I need to check if a user is authenticated. I tried everything I could
think and find:
If Membership.Vali dateUser("shapp er", "27lamps11" ) Then
Response.Write( Request.IsAuthe nticated.ToStri ng)
Response.Write( My.User.IsAuthe nticated.ToStri ng)
Response.Write( Me.User.Identit y.IsAuthenticat ed.ToString)
Else
Response.Write( "# User is Not Authenticated #")
End If
I get "FalseFalseFals e".
What is going on?
Thanks,
Miguel