I have wsse Security header included in my soap request. As part of the process I need to first validate the Id and password and after validation replace those credentials with new ones. My ask is with the original wsse:UsernameToken is an Id wsu:Id="UsernameToken-5FB9EF84098B92A24C1554127560731329" that I would like to include in the new ws security token. What would be the correct steps I need to make that happen?
<wsse:Security soap: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-5FB9EF84098B92A24C1554127560731329">
<wsse:Username>facetsivrwss</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">Gw1uarP7</wsse:Password>
<wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">/pwuZS2yzltJTmNsqmkOsw==</wsse:Nonce>
<wsu:Created>2019-04-01T14:06:00.731Z</wsu:Created>
</wsse:UsernameToken>
</wsse:Security>
Resulting wsse Security 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">
<wsu:Timestamp>
<wsu:Created>2019-04-02T17:49:30.076297399Z</wsu:Created>
<wsu:Expires>2019-04-02T17:54:30.076Z</wsu:Expires>
</wsu:Timestamp>
<wsse:UsernameToken>
<wsse:Username>SELFSERVICEIVR_TEST</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">9kTBYep4zh3M@ws</wsse:Password>
<wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">exYFjiABmMyX/NaEm72LXw==</wsse:Nonce>
</wsse:UsernameToken>
</wsse:Security>
Request Add Security Token
<?xml version="1.0" encoding="UTF-8"?>
<wsp:Policy xmlns:L7p="http://www.layer7tech.com/ws/policy" xmlns:wsp="http://schemas.xmlsoap.org/ws/2002/12/policy">
<wsp:All wsp:Usage="Required">
<L7p:AddWssSecurityToken>
<L7p:IncludeCreated booleanValue="false"/>
<L7p:IncludePassword booleanValue="true"/>
<L7p:Password stringValue="${replacementPassword}"/>
<L7p:ProtectTokens booleanValue="false"/>
<L7p:Target target="REQUEST"/>
<L7p:UseLastGatheredCredentials booleanValue="false"/>
<L7p:Username stringValue="${replacementUsername}"/>
</L7p:AddWssSecurityToken>
</wsp:All>
</wsp:Policy>
Request Apply WS-Security
<?xml version="1.0" encoding="UTF-8"?>
<wsp:Policy xmlns:L7p="http://www.layer7tech.com/ws/policy" xmlns:wsp="http://schemas.xmlsoap.org/ws/2002/12/policy">
<wsp:All wsp:Usage="Required">
<L7p:WsSecurity>
<L7p:RemoveUnmatchedSecurityHeaders booleanValue="true"/>
<L7p:UseSecurityHeaderMustUnderstand booleanValue="false"/>
</L7p:WsSecurity>
</wsp:All>
</wsp:Policy>