Highlighted
Member.
226 views

How to create Security Scenario

Hi experts,

I am setiing up a script for testing web service that uses WS-Trust. But I cannot setup Security Scenario based on information from Security Token Request. Do you have any detailed guide for setup Security Scenario?

I did check VuGen Help Center but it cannot help.

Thanks in advanced

"SOAPEnvelope="
"<s:Envelope xmlns:s=\"http://www.w3.org/2003/05/soap-envelope\" xmlns:a=\"http://www.w3.org/2005/08/addressing\" xmlns:u=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\">"
    "<s:Header>"
        "<a:Action s:mustUnderstand=\"1\">http://docs.oasis-open.org/ws-sx/ws-trust/200512/RST/Issue</a:Action>"
        "<a:MessageID>urn:uuid:a18deaa7-f5ae-4b1f-b1a0-e0cbf64acaac</a:MessageID>"
        "<a:ReplyTo>"
            "<a:Address>http://www.w3.org/2005/08/addressing/anonymous</a:Address>"
        "</a:ReplyTo>"
        "<a:To s:mustUnderstand=\"1\">https://STS_URL/Service.svc/IWSTrust13</a:To>"
       "<o:Security s:mustUnderstand=\"1\" xmlns:o=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\">"
            "<u:Timestamp u:Id=\"_0\">"
                "<u:Created>2019-03-28T10:01:52.403Z</u:Created>"
                "<u:Expires>2019-03-28T10:06:52.403Z</u:Expires>"
            "</u:Timestamp>"
            "<o:UsernameToken u:Id=\"uuid-fdb8eaa3-7de0-4fd2-89b8-e650e206fe16-1\">"
                "<o:Username>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</o:Username>"
                "<o:Password Type=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText\">xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</o:Password>"
            "</o:UsernameToken>"
        "</o:Security>"
    "</s:Header>"
    "<s:Body>"
        "<trust:RequestSecurityToken xmlns:trust=\"http://docs.oasis-open.org/ws-sx/ws-trust/200512\">"
            "<trust:RequestType>http://docs.oasis-open.org/ws-sx/ws-trust/200512/Issue</trust:RequestType>"
            "<wsp:AppliesTo xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\">"
                "<EndpointReference xmlns=\"http://www.w3.org/2005/08/addressing\">"
                    "<Address>https://WS_URL/Service.svc</Address>"
                "</EndpointReference>"
            "</wsp:AppliesTo>"
            "<trust:Entropy>"
                "<trust:BinarySecret u:Id=\"uuid-1a36f8e0-a8bd-43f4-a5f9-9e0e45297522-2\" Type=\"http://docs.oasis-open.org/ws-sx/ws-trust/200512/Nonce\">gTznKJdv9kUZqkgaebIkQX6Gz10S3uJIriSAnBBTfC8=</trust:BinarySecret>"
            "</trust:Entropy>"
            "<trust:KeyType>http://docs.oasis-open.org/ws-sx/ws-trust/200512/SymmetricKey</trust:KeyType>"
            "<trust:KeySize>256</trust:KeySize>"
            "<trust:KeyWrapAlgorithm>http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p</trust:KeyWrapAlgorithm>"
            "<trust:EncryptWith>http://www.w3.org/2001/04/xmlenc#aes256-cbc</trust:EncryptWith>"
            "<trust:SignWith>http://www.w3.org/2000/09/xmldsig#hmac-sha1</trust:SignWith>"
            "<trust:CanonicalizationAlgorithm>http://www.w3.org/2001/10/xml-exc-c14n#</trust:CanonicalizationAlgorithm>"
            "<trust:EncryptionAlgorithm>http://www.w3.org/2001/04/xmlenc#aes256-cbc</trust:EncryptionAlgorithm>"
            "<trust:SecondaryParameters>"
                "&#xD;"
                "<trust:KeyType>http://docs.oasis-open.org/ws-sx/ws-trust/200512/SymmetricKey</trust:KeyType>"
                "&#xD;"
                "<trust:KeySize>256</trust:KeySize>"
                "&#xD;"
                "<trust:Claims Dialect=\"http://schemas.xmlsoap.org/ws/2005/05/identity\">"
                    "&#xD;"
                    "<wsid:ClaimType Uri=\"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name\" Optional=\"true\" xmlns:wsid=\"http://schemas.xmlsoap.org/ws/2005/05/identity\">&#xD;"
                    "</wsid:ClaimType>"
                    "&#xD;"
                "</trust:Claims>"
                "&#xD;"
            "</trust:SecondaryParameters>"
            "<trust:ComputedKeyAlgorithm>http://docs.oasis-open.org/ws-sx/ws-trust/200512/CK/PSHA1</trust:ComputedKeyAlgorithm>"
        "</trust:RequestSecurityToken>"
    "</s:Body>"
"</s:Envelope>"
0 Likes
2 Replies
Highlighted
Micro Focus Frequent Contributor
Micro Focus Frequent Contributor

Re: How to create Security Scenario

Hi

You can open "View"-"Step Toolbox".

Then search "web_service_set_security".

When you click to add this API, it will popup a dialog.

Then you can select the type of security tokens.

For more deatils, you can search "web_service_set_security" in help file.

 

Regards,

Wei-Wei Zhang

0 Likes
Highlighted
Member.

Re: How to create Security Scenario

Sorry for late reply.

As you can see in the request, the security token comes from the Security Token Service (STS). So that using web_sevice_set_security is not enough. I did try using Security Scenario Editor but always got error:

Action.c(4): Error: InvokeMethod failure: External component has thrown an exception..
Action.c(4): Error stack trace: at Mercury.LR.LrWsNetClient.ResultArgExtractor.CreateXmlArgsDoc()
at Mercury.LR.LrWsNetClient.ResultArgExtractor.ExtractArgAsXml(String sArgPath, ArgumentExtractionType extractionType)
at Mercury.LR.LrWsNetClient.ResultArgExtractor.ExtractArg(String sArgPath, Boolean IsSaveResultArgumentsAsIs, ArgumentExtractionType extractionType)
at Mercury.LR.LrWsNetClient.ProxyCreator.ExtractArg(String sArgPath, ArgumentExtractionType extractionType)
at Mercury.LR.LrWsNetClient.NetReplay.ExtractResultArg(String sArgPath, ArgumentExtractionType extractionType, Array& barrArgValue)
Action.c(4): Error: ExtractResultArg failure: Object reference not set to an instance of an object..
Action.c(4): Error: Web service call "ComputeResponse_102" execution failed
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.