473,396 Members | 1,749 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Check if user is authenticated and get its profile. Thank you.

Hello,

I need to check if the current user is authenticated and get its
profile.

For authentication checking I got the following options:
Request.IsAuthenticated.ToString
My.User.IsAuthenticated.ToString
User.Identity.IsAuthenticated.ToString

Which one should I use?
And how can I get the profile?

Thanks,
Miguel

Feb 21 '07 #1
2 1357
Hello Shapper,

SI need to check if the current user is authenticated and get its
Sprofile.
SFor authentication checking I got the following options:
SRequest.IsAuthenticated.ToString My.User.IsAuthenticated.ToString
SUser.Identity.IsAuthenticated.ToString
SWhich one should I use?

Anyone, they are the same (u can sure it using Reflector)

SAnd how can I get the profile?

smth like
ProfileCommon pc = (ProfileCommon)context.Profile;
pc = pc.GetProfile("johndoe");
---
WBR, Michael Nemtsev [C# MVP].
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo
Feb 21 '07 #2
On Feb 21, 8:32 pm, Michael Nemtsev <nemt...@msn.comwrote:
Hello Shapper,

SI need to check if the current user is authenticated and get its
Sprofile.
SFor authentication checking I got the following options:
SRequest.IsAuthenticated.ToString My.User.IsAuthenticated.ToString
SUser.Identity.IsAuthenticated.ToString
SWhich one should I use?

Anyone, they are the same (u can sure it using Reflector)

SAnd how can I get the profile?

smth like
ProfileCommon pc = (ProfileCommon)context.Profile;
pc = pc.GetProfile("johndoe");
Those lines you wrote get the profile of a given user.
But what about the profile of the user which is currently
authenticated?
>
---
WBR, Michael Nemtsev [C# MVP].
My blog:http://spaces.live.com/laflour
Team blog:http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo
Thanks,
Miguel
Feb 22 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Sylvan | last post by:
I am new with this personalization stuff. Everything was working fine, however, now I always get the Login failed for user ''. The user is not associated with a trusted SQL Server connection....
5
by: Shimon Sim | last post by:
I am working with LogIn control and need to set some property for profile after user is authenticated. I thought that LoggedIn event is the right place but system tells me that the property can't...
6
by: Jeff | last post by:
Hey (and thank you for reading my post) In visual web developer 2005 express edition I've created a simple website project.. At this website I want users who register to be able to upload a...
3
by: shapper | last post by:
Hello, How to I check if a user is authenticated and if it is what is its role? I am using Asp.Net 2.0 and forms authentication. Thanks, Miguel
9
by: webrod | last post by:
Hi all, how can I check a user/password in a LDAP ? I don't want to connect with this user, I would like to connect to LDAP with a ADMIN_LOG/ADMIN_PWD, then do a query to find the user and...
6
by: MuZZy | last post by:
Hi, I am looking to find a way to get currently logged in user's object GUID without querying ActiveDirectory. For example, when i log in to my laptop from home, I'm not on the office network so...
4
by: TS | last post by:
i want to use these but think they may be only windows forms
2
by: shapper | last post by:
Hello, How can I check if a user is authenticated? I am using ASP.NET Membership forms authentication. Thanks, Miguel
2
by: shapper | last post by:
Hello, I am trying to get an anonymous user using the following: MembershipUser user = System.Web.Security.Membership.GetUser(); However, user is null. On my Web.Config I have the following:...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.