For Programmers: Free Programming Magazines  


Home > Archive > C# > March 2004 > How can I read login details from FormsAuthenticationTicket ?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author How can I read login details from FormsAuthenticationTicket ?
Fresh Air Rider

2004-03-28, 10:28 pm

Hi

I have implemented a system of Role-based Security with Forms
Authentication in my website which retrieves a comma separated list of
user roles via a SQL Server stored procedure. The system all works
fine except for one part.

If I log into the system, I get authenticated as expected. If I then
close my browser, change the "Username" and "Password" values in the
database and revisit the website, I still get authenticated
successfully.

I want to add some code, probably within the Session_Start event of
Global.asax to read the username / password values from the cookie and
ensure that they still match those in the database.

Could anyone please supply me with a code snippet (preferably in C#)
for retrieving the username and password from the
FormsAuthenticationTicket. I think that I probably need to use
FormsIdentity somewhere.

Many thanks in advance
John
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com