Reputation: 11
I inherited an existing and working web service written in c++ with WWSAPI. I must implement the security mechanism based on WS-Security using passworddigest in the soap header, like this one:
<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" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsse:UsernameToken wsu:Id="UsernameToken-5094D0E1418B986BF215754539660332">
<wsse:Username>test</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">sqPh/Bap7ER6j+n+2iYlI+4Qt9A=</wsse:Password>
<wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">1ROYkV/ZftvGi17KmsvgnQ==</wsse:Nonce>
<wsu:Created>2019-12-04T10:06:06.032Z</wsu:Created>
</wsse:UsernameToken>
</wsse:Security>
I'm neither a web service expert nor a WWSAPI expert, but I understand the basics of a web service. I tried to understand the WWSAPI documentation, but didn't understand where to start to implement this security.
I tested by using the binding WS_STRING_USERNAME_MESSAGE_SECURITY_BINDING_TYPE, for which I can define a password validator callback, which seems to work with a simple user/password scheme. But where/how to define a password digest security mechanism ?
With the API, I was expecting a simple setting to define the basic digest mechanism and a callback to receive the nonce, the date created, the username, and the password, but I don't understand where to start. I don't understand if this needs simple declarations (bindings + properties + callback), or if I need to write some code, for example to manually parse the xml header.
As someone implemented a WWSAAPI web service with WS-Security and how ?
Upvotes: 1
Views: 256
Reputation: 11
Ok, so, nobody seems to implement web services in pure c++ ? Anyway, I found the answer: this must be done (pratically) by hand. The main points are:
Upvotes: 0