Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Security / February 2004

Tip: Looking for answers? Try searching our database.

Active Directory

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Galore - 28 Feb 2004 00:01 GMT
Hello,

I need to get all the AD information from a user that access a intranet
ASP.NET page.Does anyone can tell me how to do it? (the user can't put its
login and password on a text box and validate it, I've got to get it by
code)

Thanks
Beginner - 28 Feb 2004 15:44 GMT
You can have one resource account that has AD query previlige and something
like

DirecotryEntry entry = new DirectoryEntry(path, username, password)

> Hello,
>
[quoted text clipped - 4 lines]
>
> Thanks
Galore - 28 Feb 2004 17:24 GMT
Thanks for your reply, but the main problem is not get information from AD,
it's how can I know which user has accessed the ASP.NET page.

[]'s

> You can have one resource account that has AD query previlige and something
> like
[quoted text clipped - 9 lines]
> >
> > Thanks
bzhang - 28 Feb 2004 17:42 GMT
You can use Request.ServerVariables["logon_user"], but there're no guarantee
that it will give you the result all the time.  Espeically if you have
non-domain or non-window users.

> Thanks for your reply, but the main problem is not get information from AD,
> it's how can I know which user has accessed the ASP.NET page.
[quoted text clipped - 16 lines]
> > >
> > > Thanks
eRic - 29 Feb 2004 00:36 GMT
To get the user name you need to turn off anonymous access on the site. IIS will then request the user's credentials.
At that point you can use the  Context.User object and get stuff like .Identity.Name

- eZe
Alexey Smirnov - 29 Feb 2004 12:32 GMT
If your AD allows to read data for anonymous users such as default iis user
when you have to turn off anonymous access and turn on Windows
Authentication only in website properties

But in many cases w/o impersonation it is not possible to get data from AD.
Either to turn on impersonation (in web.config) or to use a COM-component,
which could be executed with account of an user who has rights read AD

> To get the user name you need to turn off anonymous access on the site. IIS will then request the user's credentials.
> At that point you can use the  Context.User object and get stuff like .Identity.Name.
>
>  - eZe
Galore - 29 Feb 2004 20:48 GMT
Hmm, thanks all, I'll try these sugestions

> If your AD allows to read data for anonymous users such as default iis user
> when you have to turn off anonymous access and turn on Windows
[quoted text clipped - 10 lines]
> >
> >  - eZe

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.