Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- using (PrincipalContext ctx = new PrincipalContext(ContextType.Domain, {{domainName}}, {{myUserName}}, {{MyPassword}}))
- {
- var valid = ctx.ValidateCredentials({{givenUsername}}, {{givenPassword}});
- if (!valid)
- throw new Exception("Username or Password are incorrect");
- using (UserPrincipal qbeUser = UserPrincipal.FindByIdentity(ctx, username.ToLower()))
- {
- //stuff
- }
- }
- }```
- expected results would be that the users from both groups are able to log in
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement