Part 5: WS-Security and Authentication
Security in SOAP
WS-Security Overview
<soap:Header>
<wsse:Security
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"
soap:mustUnderstand="1">
<!-- Timestamp to prevent replay attacks -->
<wsu:Timestamp wsu:Id="TS-1">
<wsu:Created>2026-03-14T10:00:00Z</wsu:Created>
<wsu:Expires>2026-03-14T10:05:00Z</wsu:Expires>
</wsu:Timestamp>
<!-- Username and password credentials -->
<wsse:UsernameToken wsu:Id="UT-1">
<wsse:Username>api_user</wsse:Username>
<wsse:Password
Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">
<!-- Base64(SHA1(nonce + created + password)) -->
3V5JQJR...
</wsse:Password>
<wsse:Nonce EncodingType="...#Base64Binary">abc123</wsse:Nonce>
<wsu:Created>2026-03-14T10:00:00Z</wsu:Created>
</wsse:UsernameToken>
</wsse:Security>
</soap:Header>WS-Security with zeep
UsernameToken — Password Text
UsernameToken — Password Digest
Adding a Timestamp
Message Signing with X.509 Certificates
Combined: Signature + UsernameToken
Implementing WS-Security in a spyne Server
Requiring UsernameToken on the Server
Configuring TLS
Storing Credentials Securely
Security Summary
Mechanism
Provides
Requires
zeep support
What's Next
Last updated