Query LDAP

Here is an example of how to query a secure LDAP service while using a certificate for authentication.  This example utilizes a previous blog for importing the certificate:  https://blogs.msdn.microsoft.com/metaverse/2017/11/09/capturing-a-pki-certificate/ char[] commaExcape = new char[] { ‘,’ }; char quotestring = ‘”‘; string accountName = “JDUser”; string url = “server.fqdn:636”; string attrs = “uid,givenname,cn,ou”; string[] attrset…

0

Quering JSON with Certificate

I recently had a requirement to query an application that requires certificate authentication and replies with JSON.  This example utilizes a previous blog for importing the certificate:  https://blogs.msdn.microsoft.com/metaverse/2017/11/09/capturing-a-pki-certificate/ X509SecurityToken certtoken = GetSecurityToken(“a1b2c3”); X509Certificate2 cert = new X509Certificate2(certtoken.Certificate); string accountName = “JDUser”; string url = “https://server.fqdn/rest/” + accountName; ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; HttpWebRequest request = WebRequest.Create(url) as…

0

Capturing a PKI Certificate

I found it was easiest to use a certificate token when accessing systems using a certificate.  This is the method I use to accomplish the task querying based on the certificate thumbprint (the thumbprint ensures that I get correct certificate): public X509SecurityToken GetSecurityToken(string certThumb) { X509SecurityToken securityToken = null; X509Store store = new X509Store(StoreName.My, StoreLocation.LocalMachine);…

0

In the beginning

In the beginning there was the Metaverse, and the Metaverse was good.

0