My SharePoint Blog

Blogs On SharePoint Technologies


Search Site

Recent posts

Recent comments

Tags

Don't show

    Categories


    Disclaimer

    The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

    © Copyright 2008

    Authenticating to SharePoint SSL Web serivce that requires client certificate

    If you are trying to consume a Sharepoint web service - from a Windows Application - on a server that is configured for both SSL and Require Client Certificate, you need to do the following:

    1. First, export the client certifiate to a file following the directions in the section titled: "Step 1: Export the Client Certificate to a File" at this link: http://msdn2.microsoft.com/en-us/library/aa302408.aspx.
    2. Next you need to tell the web service to use that certificate like this: lists.ClientCertificates.Add(X509Certificate.CreateFromCertFile("C:\file_where_certificate_is_stored_from_above_step");
    3. Finally (and this is the part that Microsoft left out of their instructions) you need to authenticate to the web service using ONE of the following methods:
      • lists.Credentials = CredentialCache.DefaultNetworkCredentials; <-- This uses the credentials of the logged on user.
      • CredentialCache cache = new System.Net.CredentialCache(); cache.Add(new Uri(lists.Url), "Basic", new NetworkCredential(UserID, Password, Domain)); lists.Credentials = cache;

     

     


    Categories: SharePoint
    Posted by John on Friday, April 18, 2008 9:15 AM
    Permalink | Comments (0) | Post RSSRSS comment feed

    Add comment


     

    [b][/b] - [i][/i] - [u][/u]- [quote][/quote]



    Live preview

    Sunday, September 07, 2008 6:41 PM