Authentication 如何将SMSESSION值从Win客户端传递到asmx web服务进行身份验证

Authentication 如何将SMSESSION值从Win客户端传递到asmx web服务进行身份验证,authentication,single-sign-on,Authentication,Single Sign On,我正在尝试用我们的WPF应用程序实现SSO身份验证。 下面是一个场景 我们的asmx web服务由防火墙保护的web应用程序托管 要从生产服务器登录web应用程序或在浏览器中查看web服务,我们需要使用sso id登录。 我必须用我们的WPF应用程序实现SSO身份验证 首先,我必须使用第三方web服务,如果用户经过身份验证,该服务将以字符串格式返回有效的SMSESSION 然后我必须把这个SMSESSION传递给防火墙后面的web服务 现在我面临的问题是,我无法将SMSESSION值传递给我们的

我正在尝试用我们的WPF应用程序实现SSO身份验证。 下面是一个场景

  • 我们的asmx web服务由防火墙保护的web应用程序托管
  • 要从生产服务器登录web应用程序或在浏览器中查看web服务,我们需要使用sso id登录。 我必须用我们的WPF应用程序实现SSO身份验证
  • 首先,我必须使用第三方web服务,如果用户经过身份验证,该服务将以字符串格式返回有效的SMSESSION
  • 然后我必须把这个SMSESSION传递给防火墙后面的web服务
  • 现在我面临的问题是,我无法将SMSESSION值传递给我们的web服务进行身份验证
  • 当我尝试这个时,它抛出一个异常

    The content type text/html; charset=iso-8859-1 of the response message does not match the content type of the binding (text/xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 1024 bytes of the response were: '<HTML><HEAD><TITLE></TITLE></HEAD><BODY onLoad="document.AUTOSUBMIT.submit();">This page is used to hold your data while you are being authorized for your request.<BR><BR>You will be forwarded to continue the authorization process. If this does not happen automatically, please click the Continue button below.<FORM NAME="AUTOSUBMIT" METHOD="POST" ENCTYPE="application/x-www-form-urlencoded" ACTION="https://xxx.com/ssologinforms/SSO_Generic_RME.fcc?TYPE=33554432&REALMOID=06-49a328ee-0d11-103b-ad01-83323a2d304d&GUID=&SMAUTHREASON=0&METHOD=POST&SMAGENTNAME=-SM-ooM6KmTLLwbCHi%2ffOCEVUabjNhcgULT5joVqmn4M77Tf0PAu3BFcfbexTaiWfZ4N&TARGET=-SM-http%3a%2f%2fdev--srvspeq%2eog%2ege%2ecom%2fSRVSpeQWebService%2easmx"><INPUT TYPE="HIDDEN" NAME="SMPostPreserve" VALUE="+rB+TqoVGXah2Uij3lfKDdCf2jsgE2NAUoujo+dFiiJ7yzqgpQaVnxRangTzcB/faU6BOAAcSBFUMUA1RpOCnVRVjN1cFbL0KhVu3y6IySj4gJE6X797kXkzMNEZgozuEz96g6PgQ6e5+sjqZaaNGii+Cy26QaD16fqQTI5VGkLdnD0fhNvJjXXgSBLNZd77nZz0aaMmz4cGZwnAElk7POTF/NBKdxCXS1l0U/iqqozqfBz0aFqLMpsy'.
    
    如何将SMSESSION传递给asmx web服务

    string userId = txtUsername.Text.Trim(); // User to be authenticate with site minder //xxxxxxxxx
    string passwrod = txtPassward.Password.Trim(); //password of user to be authenticate with site minder //xxxxxxxx
    string applicationID = "XXXXXX"; // Application id. To be authenticate with JBoss Server.//xxxxxxxx
    string applicationPassword = "XXXXXXXXX";//applicationPassword to be authenticate with JBoss Sever.//xxxxxxxx
    
     NamespaceName.AuthenticationServiceClient proxy = new NamespaceName.AuthenticationServiceClient();
    
                    AuthenticationServiceRequest request = new AuthenticationServiceRequest();
                    UserAttributes ut = new UserAttributes();
                    ut.userName = userId;
                    ut.password = passwrod;
                    request.userAttributes = ut;
                    AuthenticationServiceResponse response = null;
                    try
                    {
                        ServicePointManager.Expect100Continue = false;
                        proxy.ClientCredentials.UserName.UserName = applicationID;
                        proxy.ClientCredentials.UserName.Password = applicationPassword;
    
                        response = proxy.passwordAuthenticate(request);
    
                        if (response.result != null)
                        {
                            switch (response.result.ToString())
                            {
                                case "SUCCESS":
                                    MessageBox.Show("Valid SMSESSION :" + response.smSession.ToString());
                                    break;
                                case "ERROR":
                                    MessageBox.Show("ERROR CODE :" + response.errCode.ToString() + "\n Error Message :" + response.errMsg.ToString());
                                    break;
                                default: MessageBox.Show("Response is neither SUCCESS nor ERROR, its something different\nERROR CODE :" + response.errCode.ToString() + "\n " + response.errMsg.ToString());
                                    break;
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message);
                    }
    }