none
WCF with SiteMinder authentication enabled RRS feed

  • Question

  • I have a WCF service (wsHttpsbinding) hosted in IIS 7.5 with SiteMinder ISAPI filter enabled.  As soon as I enable SiteMinder authentication, the service call failed with this error message.  

    The content type text/html of the response message does not match the content type of the binding (text/html;charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly.  The first 119 bytes of the response were: '<HEAD><TITLE>500:Server Error [10-0002]</TITLE></HEAD><H1>500: Server Error [10-0002]<H1></BODY></HTML>

    Is there an example of such configuration somewhere?  What do I need to do in the client and the service to enable this configuration to work? 

    Thanks for any help on this.

      

    Wednesday, May 1, 2013 12:32 PM

All replies

  • Hi,

    Please make sure you have SiteMinder configured properly, you can refer 'Chapter 3: Configure a SiteMinder Agent for IIS or Web Agent on an IIS Web Server' of this document.

    If the issue still exists, you need enable tracing for your service to help to diagnose the actual issue, and use SvcTraceViewer.exe tool to analyze the diagnostic traces.

    In addition, since this issue is related to some third party component, I would suggest you get better help from their official support. Thanks for your understanding.

    Best Regards.


    Haixia
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, May 2, 2013 2:47 AM
    Moderator
  • Is there an example of wcf service using SiteMinder for authentication somewhere?

    Thursday, May 2, 2013 7:44 PM
  • Hi,

    I do not find a complete sample available, but here are some threads below for your information.

    Use of Siteminder tokens in WCF to authenticate against siteminder

    http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/4435ea55-4609-4122-8aae-5b34abe00c42/

    How to call WCF Http Service behind SiteMinder

    http://stackoverflow.com/questions/5261920/how-to-call-wcf-http-service-behind-siteminder

    Hope it helps.

    Best Regards.


    Haixia
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, May 3, 2013 9:54 AM
    Moderator
  • How can I obtain the SiteMinder cookies with my client? I followed a codeproject site article here

    http://www.codeproject.com/Articles/80314/How-to-Connect-to-a-SiteMinder-Protected-Resource?msg=4665681#xx4665681xx
    My code block using C# is as follows. 
        HttpWebRequest myHttpWebRequest = (HttpWebRequest)WebRequest.Create("my web service page");
                //myHttpWebRequest.ClientCertificates.Add(clientCert);
                myHttpWebRequest.AllowAutoRedirect = false;
                myHttpWebRequest.KeepAlive = false;
                HttpWebResponse response = (HttpWebResponse)myHttpWebRequest.GetResponse();
                if (response.StatusCode == HttpStatusCode.Found)
                {
                    //WebHeaderCollection headerCollection = response.Headers;
                    string[] urlStrings = response.Headers.GetValues("Location");
                    string url = urlStrings[0];
                    myHttpWebRequest = (HttpWebRequest)WebRequest.Create(url);
                    myHttpWebRequest.CookieContainer = new CookieContainer();
                    myHttpWebRequest.Method = "POST";
                    myHttpWebRequest.AllowAutoRedirect = false;
                    //myHttpWebRequest.ContentLength = 0;
                    if (clientCert.Verify())
                    {
                        myHttpWebRequest.ClientCertificates.Add(clientCert);
                        myHttpWebRequest.ContentType = "text/html;chartset=ISO-8859-1";
                        myHttpWebRequest.KeepAlive = false;
                        HttpWebResponse response2 = (HttpWebResponse)myHttpWebRequest.GetResponse(); -- it errors out.
                        ...
                     }
                 }
    But when I call the url I got this error message:  The request was aborted: Cannot create SSL/TLS secure channel.
    • Edited by mysti789 Monday, September 23, 2013 8:19 PM
    Monday, September 23, 2013 7:19 PM