12 May

Displaying Account details from Active Directory

Filed under Web Development on May 12, 2008 at 12:55 pm.

Recently I updated a Web application I built last year to use Active Directory as a way of user authenication instead of prompting for usernames and passwords.

I have not worked with ASP.NET much so my knowledge is poor especially the AD connector objects. However I thought it might be nice to share my example it since it was relevative easy to complete...

First of all, let me explain what is happening!

In my VB, I first get the username of the person logged into the machine on our network. This username value comes back as: DOMAINusername.

I then connect to AD and pass my username. Notice i'm splitting the username value as I don't need the DOMAIN part...

Once a connection is made, I retrieve some details like the users Firstname, Lastname and Email address. I have also included the member security groups since some pages of the application were controlled this way...

Obviously there is alot more happening and what I have posted below is just an exmaple to display the information from AD. You could take this futher by storing this info in a Session so you could reuse it throughout the Web Application.

http://www.seandelaney.co.uk/free-scripts/11_asp.net/3_displaying-account-details-from-active-directory/

My Fancy Artistic Separator

You can follow all my blog posts through the RSS 2.0 icon RSS 2.0 feed. You can leave a response, or trackback from your own site to this post and its comments.

Leave Your Comment

Please keep all comments related to this topic and be nice, don't spam as un-related or spam comments will be deleted!

Share This Blog Post

My Fancy Artistic Separator

Gravatar Enabled

The comments on my blog are now Gravatar-enabled so when you leave your comment your face appears beside your name. Do you have an account yet? External Link

My Fancy Artistic Separator

Trackbacks

Yes thats right - you can now track all my blog entries using Ran Aroussi's PHP trackback External Link class that I have intergrated into my blog. It is a simple, portable PHP class with full TrackBack capabilites - Thanks Ran External Link!

My Fancy Artistic Separator

Powered By Me

Like this entire website, this blog was all handed coded by me using OOPHP. I did however look into using the powerful Wordpress CMS but since I'm a programmer, I decided to develop my own. There was nothing wrong with the Wordpress tool but it just didnt tickle my fancy to be honest! If your interested in learning more please drop me a line.

My Fancy Artistic Separator

Communities