Full name & email from principal

D

David Thielen

Hi;

I am supporting both ActiveDirectory and the built-in 2.0 forms support for
authentication/authorization. How can I get the user's full name and email
address in each case?
 
J

Joe Kaplan \(MVP - ADSI\)

By full name, do you mean the AD displayName attribute? For email address,
you'd need to do an LDAP lookup to AD, searching based on the name the user
used to authenticate, and retrieve the attributes you want (like mail and
displayName, if that's what you meant). You would basically just use the
DirectorySearcher class for that.

Joe K.
 
D

David Thielen

Hi;

Yes & yes. However, I also need it when they use forms authentication which
uses the built-in asp 2.0 .net stuff. Those columns are in the database it
creates. But there seems to be no way to get them.
 
J

Joe Kaplan \(MVP - ADSI\)

I'm not sure how to get them from the membership database. Someone else
will konw though.

Do you need help with the LDAP query?

Joe K.
 
D

David Thielen

Hi;

I don't think so - I have some code I wrote awhile ago that did this so I
just need to find it. Thank you for the offer.
 
D

Dominick Baier [DevelopMentor]

the database has a bunch of stored procedure, which are called from the membership
provider,

Membership.GetUser returns a MembershipUser object which contains all info
membership knows about...
 
D

Dominick Baier [DevelopMentor]

the static Membership class is a facade to the provider - the rest is done
in web.config.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,162
Latest member
GertrudeMa
Top