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
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Validate User Id and Password with AD
Khan Abrar Ahmed
Jun 10
2015
Code
1.1
k
0
1
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
string
username =
"ABC"
;
string
password=
"abc"
;
bool
result =
false
;
string
domain = System.Configuration.ConfigurationSettings.AppSettings[
"Domain"
];
using
(PrincipalContext pc =
new
PrincipalContext(ContextType.Domain, domain))
{
result =pc.ValidateCredentials(username, password);
}
if
( result )
{
alert(
"User validated"
);
}
C#
ASP.net