473,769 Members | 2,249 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.IsAuthe nticated.ToStri ng
My.User.IsAuthe nticated.ToStri ng
User.Identity.I sAuthenticated. ToString

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

Thanks,
Miguel

Feb 21 '07 #1
2 1374
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.IsAuth enticated.ToStr ing My.User.IsAuthe nticated.ToStri ng
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.co mwrote:
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.IsAuth enticated.ToStr ing My.User.IsAuthe nticated.ToStri ng
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
4860
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. error message. This is for anonymous personalization, very simple. I am just trying to retrieve a string from Profile. This is what I have in my web.config file: <system.web>
5
4175
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 be set for anonymous user. I checked User.Identity.IsAuthenticated = false. So when is the good place to set profile properties? Again I need to set up it only once right after user logged in. Thank you.
6
8124
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 picture of themselves to their profile... I admit that I'm a newbie... but this is how I understand this:
3
4606
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
15529
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 check the password. The thing is I can't access the password attribute to compare with the user's password provided.
6
5667
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 i can't reach AD but I'm sure i still can get my AD's objectGUID, as the profile is cached locally. Any ideas?
4
2118
by: TS | last post by:
i want to use these but think they may be only windows forms
2
1643
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
2392
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: <anonymousIdentification cookieless="UseCookies"
0
10223
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10051
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7413
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6675
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5310
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3968
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3571
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.