locked
WS Security Password Digest RRS feed

  • Question

  • Hello Everyone;

    I have a Ws request which includes user token:


    <?xml version="1.0" encoding="UTF-8" ?>
    - <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
    - <soap:Header>
    - <wsse:Security soap:mustUnderstand="true" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
    - <wsse:UsernameToken wsu:Id="UsernameToken-12" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
    <wsse:Username>MUSTY</wsse:Username>
    <wsse:Password Type="PasswordDigest">sfasdfaQWDfceqwdqwefqweQWDQW==</wsse:Password>
    <wsse:Nonce EncodingType="Base64Binary">EFD89F06CCB28C89</wsse:Nonce>
    <wsu:Created>2011-01-12T15:55:00Z</wsu:Created>
    </wsse:UsernameToken>
    </wsse:Security>
    </soap:Header>
    - <soap:Body>
    - <ns1:UploadInvoiceFilesRequest xmlns:ns1="http://schemas.konya.com/kny/ws/invoice/1.0" guid="121212">
    <XmlFile>1212</XmlFile>
    <PdfFile>12121</PdfFile>
    </ns1:UploadInvoiceFilesRequest>
    </soap:Body>
    </soap:Envelope>

    I sent request to WS.I get "Message processing failed. Cause: com.sap.engine.interfaces.messaging.api.exception.MessagingException: The security token could not be authenticated or authorized; nested exception is org.apache.ws.security.WSSecurityException: The security token could not be authenticated or authorized".
    I guess password digest is wrong.I create depends on this format:
    Password_Digest = Base64 ( SHA-1 ( nonce + created + password ) ).
    However I get same error.
    Can you help me about this problem.How should I create password digest?

    Wednesday, January 12, 2011 2:55 PM

Answers

  • use this utility to send password digest with wcf:

    http://blogs.msdn.com/b/aszego/archive/2010/06/24/usernametoken-profile-vs-wcf.aspx

    http://webservices20.blogspot.com/
    WCF Security, Interoperability And Performance Blog
    • Marked as answer by Yi-Lun Luo Tuesday, January 18, 2011 9:16 AM
    Wednesday, January 12, 2011 3:20 PM