steros
8 years agoNew Contributor
how to sign UsernameToken?
Hi,
the api I try to communicate with requires to sign the UsernameToken. How do I do that?
Whatever I try either the UsernameToken is removed from the request upon signing or nothing is signed at all.
The api expects a soapenv:Envelope .
Here is what I did so far:
I created two outgoing ws-security configurations:
- Username
- type: username
- pwd type: PasswordText
- do not add nonce or created
- Signature
- type: signature
- Binary Security Token
- single certificate for signing
- several parts added
To create the final request I now do:
- click "outgoing wss" -> apply username
- now the UsernameToken is added to the request as expected
- click "outgoing wss" -> apply signature
- now the UsernameToken is removed
- send the request
or
- add the UsernameToken to the request manually
- click "outgoing wss" -> apply signature
- now the UsernameToken is removed
- nothing is signed
- send the request
Problem is that upon applying signature the UsernameToken is removed from the request. If I just add it manually to the request xml and put the UsernameToken to the parts to be sign nothing get's signed at all.
When adding the UsernameToken to the parts to be signed I add it like this:
- Name: UsernameToken
- Namespace: http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd
- Encode: Content