Demetri ha scritto:
Hello,
My company has charged me with creating a web service that will validate a
user and return the user's roles via Active Directory.
The requirement is that the web service must return data to any consumer.
This means the consumer may be a Java app or any app on any platform.
Now, my knowledge of returning data to consumers who are not .Net
applications or platforms is limited. I was told to make sure that SOAP
headers contain all the correct information, etc.
Can anyone explain what it entails to accomplish such a feat? Or atleast
point me to an article or some such that will help me in my quest?
Thanks
Demetri,
you shod drop a look @ System.DirectoryServices.
This namespace cant put your .NET WS in the Active Directory World.
All you need is getting connect with AD Server, you can use this code as
a template.
System.DirectoryServices.DirectoryEntry myDE = new
System.DirectoryServices.DirectoryEntry(@"LDAP://DC=" + domain +
",DC=it", domainAdminUsername, domainAdminPassword,
System.DirectoryServices.AuthenticationTypes.Secur e);
as you seen is not so hard like seems.
Just pass the domain controller name and a pair of credentials that have
the rights to interact with AD.
At this time you are almost ready to perform query against AD with
DirectorySearcher. Use myDE (code above) as your SearchRoot and then..
query :)
DirectorySearcher expose a lot of methods and properties like
caching,maxresult for query and so on.
This is the way.
If you need more informations you can catch them on
(
http://msdn.microsoft.com/library/de...mberstopic.asp)
Hope this Help.
Greetz
Alessio