Facebook
From Whipped Moth, 4 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 156
  1.             const string LDAP_PATH = "EX://ldap.pjwstk.edu.pl";
  2.             const string LDAP_DOMAIN = "ldap.pjwstk.edu.pl";
  3.  
  4.             using (var context = new PrincipalContext(ContextType.Domain, LDAP_DOMAIN, "pgago", "xxx"))
  5.             {
  6.                 if (context.ValidateCredentials("pgago", "xxx"))
  7.                 {
  8.                     using (var de = new DirectoryEntry(LDAP_PATH))
  9.                     using (var ds = new DirectorySearcher(de))
  10.                     {
  11.                         var identities = new List<ClaimsIdentity> { new ClaimsIdentity("custom auth type") };
  12.  
  13.                     }
  14.                 }
  15.             }