TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Vishwas Kadamannaya
1.6k
122
142.5k
ASP.net Web Application with AD Security
Jan 9 2013 7:06 AM
Hi All,
I need to create a web Application to my company, where only the people who are in a Particular Active Directory group will be able to access the website, and i created a master page and added the code for validating the user for particular AD and it works fine in my local, i have used LDAP, but when i hosted this web application in our server IIS but this code does not work .
using (DirectoryEntry de = new DirectoryEntry("LDAP://" + "Domain")) // domain of user who tries to access website
{
using (DirectorySearcher
adSearch = new DirectorySearcher(de))
{
adSearch.Filter = "(sAMAccountName=" + "User" + ")"; // user who tries to access the website
adSearch.PropertiesToLoad.Add("department");
var result = adSearch.FindOne();
if (result != null)
{
try
{
string department = result.Properties["department"][0].ToString();
}
}
}
}
Any Ideas why this does not work in server and works fine in local, or any of u have done such a webapp.
Thanks in Advance
Vishwa
Reply
Answers (
0
)
Validate user password against domain policy
access active directory frm another network using c#