Request.IsAuthenticated is not just for forms authentciation - it is valid no matter what type of authentication is being used (Windows, Passport, Forms or our own custom scheme)
HttpRequest.IsAuthenticated will be true when the user making the request has been authenticated. Essentially, this property provides the same information as Context.User.Identity.IsAuthenticated.
Request.IsAuthenticated checks to see if the request being sent is authenticated - using on the login page is too early if the Authentication code for you application has not yet been called (ie before your login control click button has been called).
If you have your login code working, then the Request.IsAuthenticated property on the Default.aspx page will work (if you have logged in)
Marked as answer by inungh on Nov 06, 2012 02:55 AM
inungh
Member
68 Points
183 Posts
Request.IsAuthenticated
Nov 05, 2012 04:57 AM|LINK
Can I assume "Request.IsAuthenticated" get results that user is Authenticated?
I tried it on login.aspx and check the result is false even I have right user name and password.
If I can not use this which class I can use to know is user authenticated?
Your help and information is great appreciated,
Regards,
inungh,
chandu123
Contributor
4646 Points
1172 Posts
Re: Request.IsAuthenticated
Nov 05, 2012 05:00 AM|LINK
Request.IsAuthenticated is not just for forms authentciation - it is valid no matter what type of authentication is being used (Windows, Passport, Forms or our own custom scheme)
HttpRequest.IsAuthenticated will be true when the user making the request has been authenticated. Essentially, this property provides the same information as Context.User.Identity.IsAuthenticated.
http://stackoverflow.com/questions/2105391/how-to-set-request-isauthenticated-to-true-when-not-using-formsauthentication-re
Chandrasekhar (MCTS) .NET framework 3.5, ASP.NET Applications
If my ANSWER helps you in solving your problem MARK IT AS ANSWER
inungh
Member
68 Points
183 Posts
Re: Request.IsAuthenticated
Nov 05, 2012 05:26 AM|LINK
Is it too earlier or too late to check this when user click on login, since the server might not authenticate user yet?
Should I use on the page load on Default.aspx?
Thanks agian for helping,
Regards,
Inungh,
niceastham
Member
645 Points
175 Posts
Re: Request.IsAuthenticated
Nov 05, 2012 08:10 AM|LINK
Request.IsAuthenticated checks to see if the request being sent is authenticated - using on the login page is too early if the Authentication code for you application has not yet been called (ie before your login control click button has been called).
If you have your login code working, then the Request.IsAuthenticated property on the Default.aspx page will work (if you have logged in)
chandu123
Contributor
4646 Points
1172 Posts
Re: Request.IsAuthenticated
Nov 05, 2012 08:18 AM|LINK
After he enters the username and pwd you have to check whether he is authenticated or not before that how can you do it??Check in the login page
Chandrasekhar (MCTS) .NET framework 3.5, ASP.NET Applications
If my ANSWER helps you in solving your problem MARK IT AS ANSWER
niceastham
Member
645 Points
175 Posts
Re: Request.IsAuthenticated
Nov 05, 2012 08:27 AM|LINK
Are you using Forms authentication? If so, you can use Membership.ValidateUser(username As String, password As String)
inungh
Member
68 Points
183 Posts
Re: Request.IsAuthenticated
Nov 06, 2012 02:56 AM|LINK
Thanks a million for helping and information,
regards,
inungh,