none
SOAP HEADER AUTHENTICATION ISSUE RRS feed

  • Question

  • I am using network authentication but getting an Authentication error. need to send username and password in the SOAP Header

    //------------------------------------------------------------------

    //STEP 2: CREATE CREDENTIALS OBJECT CONTAINING USERNAME AND PASSWORD

    //------------------------------------------------------------------

    NetworkCredentialPPCcredentials = newNetworkCredential(txtUserName.ToString(), txtPassword.ToString());

    Uriuri = newUri(webService.Url);

    CredentialCachecredentials = newCredentialCache();

    credentials.Add(uri,"Basic", PPCcredentials);

    request need to have the following header: 

    <soapenv:Header> 
    <wsse:Security soapenv:mustUnderstand="1" 
    xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd&q
    uot; xmlns:wsu="http://docs.
    oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> 
    <wsse:UsernameToken wsu:Id="UsernameToken-8D2E5C87643638F61D14968505181211"> 
    <wsse:Username>userxxx</wsse:Username> <wsse:Password 
    Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-
    1.0#PasswordText">pwdxxxxx</wsse:Password> <wsse:Nonce 
    EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-secur
    ity-1.0#Base64Binary">h1J+B/PCqCvQmcc+mtt+iA==</wsse:Nonce> 
    <wsu:Created>2017-06-07T15:48:38.115Z</wsu:Created> </wsse:UsernameToken> 
    </wsse:Security> 
    </soapenv:Header

    • Moved by Fei Hu Wednesday, December 20, 2017 1:37 AM from C#
    Tuesday, December 19, 2017 8:22 PM

All replies

  • Hi Edictius,

    Your question is more related to Web Authentication, you could post a new thread to ASP.NET Forum for suitable support. If you have some grammar or code errors in using C#, please feel free to contact us. We will try our best to give you a solution.

    Best Regards,

    Neil Hu


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Edited by Fei Hu Wednesday, December 20, 2017 1:37 AM
    Wednesday, December 20, 2017 1:33 AM