Статус: Новичок
Группы: Участники
Зарегистрирован: 08.11.2016(UTC) Сообщений: 8
|
Добрый день. Прошу прощения за объем. Столкнулся с проблемой: пытаюсь настроить взаимодействие с DSS через двухфакторную аутентификацию. 1. Вызываю http://dss.cryptopro.ru/STS/Active.svc2. Сообщение отправляю скопированное из гайда cryptopro_dss_dev_guide.pdf глава 7.2, так как интересует пока только пинг-понг Код:<s:Envelope xmlns:a="http://www.w3.org/2005/08/addressing"
xmlns:s="http://www.w3.org/2003/05/soap-envelope">
<s:Header>
<a:Action s:mustUnderstand="1">http://docs.oasis-open.org/ws-sx/wstrust/200512/RST/Issue</a:Action>
</s:Header>
<s:Body>
<trust:RequestSecurityToken xmlns:trust="http://docs.oasis-open.org/ws-sx/wstrust/200512">
<wsp:AppliesTo xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
<wsa:EndpointReference xmlns:wsa="http://www.w3.org/2005/08/addressing">
<wsa:Address>http://localhost/SignService/</wsa:Address>
</wsa:EndpointReference>
</wsp:AppliesTo>
<trust:Claims xmlns:auth="http://docs.oasisopen.org/wsfed/authorization/200706"
Dialect="http://docs.oasisopen.org/wsfed/authorization/200706/authclaims">
<auth:ClaimType Uri="http://dss.cryptopro.ru/identity/claims/dsstransactionid"
Optional="false">
<auth:Value>1280</auth:Value>
</auth:ClaimType>
<auth:ClaimType
Uri="http://dss.cryptopro.ru/identity/claims/dsstransactionexpiredate"
Optional="false"></auth:ClaimType>
</trust:Claims>
<trust:KeyType>http://docs.oasis-open.org/ws-sx/wstrust/200512/SymmetricKey</trust:KeyType>
<trust:RequestType>http://docs.oasis-open.org/ws-sx/wstrust/200512/Issue</trust:RequestType>
<auth:AdditionalContext xmlns:auth="http://docs.oasisopen.org/wsfed/authorization/200706">
<auth:ContextItem
Name="http://dss.cryptopro.ru/identity/confirmationtext/unformatted">
<auth:Value>C:\Вторичная аутентификация в КриптоПро DSS.vsd</auth:Value>
</auth:ContextItem>
</auth:AdditionalContext>
</trust:RequestSecurityToken>
</s:Body>
</s:Envelope>
Получаю ожидаемый fault: Ошибка при проверке безопасности сообщения. То есть необходимо подписать сообщение. 3. Выпускаю сертификат пр помощи keytool, добавляю его к хранилищу ключей dss.cryptopro.ru.jks и в cacerts 4. Подписываю и отправляю. Код:<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
<env:Header>
<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" env:mustUnderstand="1">
<wsse:BinarySecurityToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3" wsu:Id="XWSSGID-1478600839532-620813729" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">MIIDaTCCAlGgAwIBAgIEdPQV2zANBgkqhkiG9w0BAQsFADBlMQswCQYDVQQGEwJydTEQMA4GA1UECBMHVW5rbm93bjEMMAoGA1UEBxMDc3BiMQ0wCwYDVQQKEwRjcm9jMQwwCgYDVQQLEwNkaXQxGTAXBgNVBAMTEGFuZHJleSBsYXphcmVua28wHhcNMTYxMTA3MTU1NjQ2WhcNMTcwMjA1MTU1NjQ2WjBlMQswCQYDVQQGEwJydTEQMA4GA1UECBMHVW5rbm93bjEMMAoGA1UEBxMDc3BiMQ0wCwYDVQQKEwRjcm9jMQwwCgYDVQQLEwNkaXQxGTAXBgNVBAMTEGFuZHJleSBsYXphcmVua28wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCSl89FaZEViLPdXijciFTYbMFGzOk+VZQwkk/zS+X3Un+sqei5vc54p60jSd8ZGJveagW9Y/r5IrHNJqlb+JqA6Ld4JBEL1v8D3GPGbUk/Te2Q/ZtoMAZdnF3tMLXAMexWmv2incWP+it8Kq7yLlt2KcFztCkJeMlPboPw+/KimpUIS3vq1D96q6yPMose5f6YYxLum2aVYbtYUX1SB/MfAEAFG6ZAslfi6kVHzWRm2AN85/5QsX1l6hIVmaJC4ODvcRw8mOeZznbK3N7IUrpwPnnJyUMDnDK3fWlMplaMg6LFH5e87ZMiAr+U9CVulafVB5geYcP+thmm6iYWydazAgMBAAGjITAfMB0GA1UdDgQWBBRGdteEu0IfX120Ia8KV6NYX6WruzANBgkqhkiG9w0BAQsFAAOCAQEABF/FLfawnODdxsa+tmMH9n5GFjHd2uSv5ahGD3n1/UDuejizsNcUIBjpAjYQurYdkjp7rts2yiAzsN34Ay4dY3BQ3g3mKkArT4aKJvldryUcEMSNAcnbNk/SZ+GBAWF04AzmDm6bZR+7heFcunj7hrSHDiYtxPmQlHGdV/5ro3KEuBgkxrEXFL88tB2DoTg/s1FBoxVZGISnlZQl8O4b8cdfXAM4CoAVMAl3NJyhjBFaTju+vSAbovfaiCFajKu9qSVl/T3VFV6AJJeHEkiEb41SqXMs4qnP5rWJeXXxhW6LIGzxRgubfaYIh/esbXMAQzLPF0jBiSjsPEZ7BUyZsw==</wsse:BinarySecurityToken>
<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#" Id="XWSSGID-1478600839529267475467">
<ds:SignedInfo>
<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
<InclusiveNamespaces xmlns="http://www.w3.org/2001/10/xml-exc-c14n#" PrefixList="wsse env"/>
</ds:CanonicalizationMethod>
<ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
<ds:Reference URI="#XWSSGID-14786008397792144844704">
<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
<ds:DigestValue>m+5ez9WtbLAhtWv2kQIqboMf738=</ds:DigestValue>
</ds:Reference>
</ds:SignedInfo>
<ds:SignatureValue>hP7ymqWE8T0SA/VBu/eEGmM9KMJE/nj7ON8FxEy/deJKzYL5JvOfB7gs9RMg0EoOkTTyXs4AQZqv
M9WPaHrfA/SCCxDGdAyhNPpF2GFEQDSOxN4kDnRpUhGa9sO1rl4ci/TMUAXmxaQY8pkYqr7kEaWC
xnDMwDSndoXytU05vynFd232ONHl5LUj0CL/Y2VAZRRcdGQAvRBuXMGZ0qCDLt7lUSGvNts44re3
C21WTtUfUD0N3fR6sFeyCODFdEZiNJiDmN8iNLMkZisLuHZ3LN4Wu6/67/uZQg7fuIiCRVKkaQem
jPmS2OHnGOuGRJ+BbrbDiPmkEaLH8E9AO/WBHw==</ds:SignatureValue>
<ds:KeyInfo>
<wsse:SecurityTokenReference xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="XWSSGID-14786008397631474906779" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<wsse:Reference URI="#XWSSGID-1478600839532-620813729" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3"/>
</wsse:SecurityTokenReference>
</ds:KeyInfo>
</ds:Signature>
</wsse:Security>
</env:Header>
<env:Body xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="XWSSGID-14786008397792144844704">
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing">
<s:Header>
<a:Action s:mustUnderstand="1">http://docs.oasis-open.org/ws-sx/wstrust/200512/RST/Issue</a:Action>
</s:Header>
<s:Body>
<trust:RequestSecurityToken xmlns:trust="http://docs.oasis-open.org/ws-sx/wstrust/200512">
<wsp:AppliesTo xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
<wsa:EndpointReference xmlns:wsa="http://www.w3.org/2005/08/addressing">
<wsa:Address>http://localhost/SignService/</wsa:Address>
</wsa:EndpointReference>
</wsp:AppliesTo>
<trust:Claims xmlns:auth="http://docs.oasisopen.org/wsfed/authorization/200706" Dialect="http://docs.oasisopen.org/wsfed/authorization/200706/authclaims">
<auth:ClaimType Optional="false" Uri="http://dss.cryptopro.ru/identity/claims/dsstransactionid">
<auth:Value>1280</auth:Value>
</auth:ClaimType>
<auth:ClaimType Optional="false" Uri="http://dss.cryptopro.ru/identity/claims/dsstransactionexpiredate"/>
</trust:Claims>
<trust:KeyType>http://docs.oasis-open.org/ws-sx/wstrust/200512/SymmetricKey</trust:KeyType>
<trust:RequestType>http://docs.oasis-open.org/ws-sx/wstrust/200512/Issue</trust:RequestType>
<auth:AdditionalContext xmlns:auth="http://docs.oasisopen.org/wsfed/authorization/200706">
<auth:ContextItem Name="http://dss.cryptopro.ru/identity/confirmationtext/unformatted">
<auth:Value>C:\Вторичная аутентификация в КриптоПро DSS.vsd</auth:Value>
</auth:ContextItem>
</auth:AdditionalContext>
</trust:RequestSecurityToken>
</s:Body>
</s:Envelope>
</env:Body>
</env:Envelope>
В ответ получаю уже другой fault: Обработка сообщения невозможно, так как действие "" недопустимо или нераспознано. 5. То же самое при использовании запроса из DSSWSTrustJava. Код:<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
<env:Header>
<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" env:mustUnderstand="1">
<wsse:BinarySecurityToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3" wsu:Id="XWSSGID-1478601062610-1371058052" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">MIIDaTCCAlGgAwIBAgIEdPQV2zANBgkqhkiG9w0BAQsFADBlMQswCQYDVQQGEwJydTEQMA4GA1UECBMHVW5rbm93bjEMMAoGA1UEBxMDc3BiMQ0wCwYDVQQKEwRjcm9jMQwwCgYDVQQLEwNkaXQxGTAXBgNVBAMTEGFuZHJleSBsYXphcmVua28wHhcNMTYxMTA3MTU1NjQ2WhcNMTcwMjA1MTU1NjQ2WjBlMQswCQYDVQQGEwJydTEQMA4GA1UECBMHVW5rbm93bjEMMAoGA1UEBxMDc3BiMQ0wCwYDVQQKEwRjcm9jMQwwCgYDVQQLEwNkaXQxGTAXBgNVBAMTEGFuZHJleSBsYXphcmVua28wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCSl89FaZEViLPdXijciFTYbMFGzOk+VZQwkk/zS+X3Un+sqei5vc54p60jSd8ZGJveagW9Y/r5IrHNJqlb+JqA6Ld4JBEL1v8D3GPGbUk/Te2Q/ZtoMAZdnF3tMLXAMexWmv2incWP+it8Kq7yLlt2KcFztCkJeMlPboPw+/KimpUIS3vq1D96q6yPMose5f6YYxLum2aVYbtYUX1SB/MfAEAFG6ZAslfi6kVHzWRm2AN85/5QsX1l6hIVmaJC4ODvcRw8mOeZznbK3N7IUrpwPnnJyUMDnDK3fWlMplaMg6LFH5e87ZMiAr+U9CVulafVB5geYcP+thmm6iYWydazAgMBAAGjITAfMB0GA1UdDgQWBBRGdteEu0IfX120Ia8KV6NYX6WruzANBgkqhkiG9w0BAQsFAAOCAQEABF/FLfawnODdxsa+tmMH9n5GFjHd2uSv5ahGD3n1/UDuejizsNcUIBjpAjYQurYdkjp7rts2yiAzsN34Ay4dY3BQ3g3mKkArT4aKJvldryUcEMSNAcnbNk/SZ+GBAWF04AzmDm6bZR+7heFcunj7hrSHDiYtxPmQlHGdV/5ro3KEuBgkxrEXFL88tB2DoTg/s1FBoxVZGISnlZQl8O4b8cdfXAM4CoAVMAl3NJyhjBFaTju+vSAbovfaiCFajKu9qSVl/T3VFV6AJJeHEkiEb41SqXMs4qnP5rWJeXXxhW6LIGzxRgubfaYIh/esbXMAQzLPF0jBiSjsPEZ7BUyZsw==</wsse:BinarySecurityToken>
<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#" Id="XWSSGID-1478601062607704395011">
<ds:SignedInfo>
<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
<InclusiveNamespaces xmlns="http://www.w3.org/2001/10/xml-exc-c14n#" PrefixList="wsse env"/>
</ds:CanonicalizationMethod>
<ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
<ds:Reference URI="#XWSSGID-1478601062861-1652700286">
<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
<ds:DigestValue>Ds22A+UcyX1DIa/OM5HYu4C3f6g=</ds:DigestValue>
</ds:Reference>
</ds:SignedInfo>
<ds:SignatureValue>LCqvglLI1T0/Lhlg1RE1ZJILBDxTuRq55vMx/o/Nrbe7MrtS0rn5nIzatXThlZybtDMsIVNnr8pM
4Z8SX2/Ban0nFu/s+5xcLOYmuBNRxVrdaoo7zGIl+A3Sv+OQiAuFZrxcPvXMV6OA4a1IrM5rMBtA
N7MxeZKwArRbYlC5D432eCvbbGqJS/a5h49K/CFtqFiUr7AbBufIJs8SYSk256QLJaJefqoLvqCD
3Q1xVyRmTAL+7rnEN53elGCxNc+UaL3Stt/L5Q8IfkHXxOBfd2hrXPEafR/PXoob7hPIOB3LiR4K
d8WQD0PYY6A4hBB/8r5DYDcevBOr1ju6LBp1lA==</ds:SignatureValue>
<ds:KeyInfo>
<wsse:SecurityTokenReference xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="XWSSGID-1478601062847-1388476873" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<wsse:Reference URI="#XWSSGID-1478601062610-1371058052" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3"/>
</wsse:SecurityTokenReference>
</ds:KeyInfo>
</ds:Signature>
</wsse:Security>
</env:Header>
<env:Body xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="XWSSGID-1478601062861-1652700286">
<S:Envelope xmlns:S="http://www.w3.org/2003/05/soap-envelope">
<S:Body>
<trust:RequestSecurityToken xmlns:trust="http://docs.oasis-open.org/ws-sx/ws-trust/200512" xmlns:ns11="http://schemas.xmlsoap.org/ws/2006/02/addressingidentity" xmlns:ns12="http://www.w3.org/2000/09/xmldsig#" xmlns:ns13="http://docs.oasis-open.org/ws-sx/ws-trust/200802" xmlns:ns15="http://www.w3.org/2001/10/xml-exc-c14n#" xmlns:ns2="http://docs.oasis-open.org/wsfed/authorization/200706" xmlns:ns8="http://docs.oasis-open.org/wss/oasis-wss-wssecurity-secext-1.1.xsd" xmlns:ns9="http://docs.oasis-open.org/ws-sx/ws-trust/200512/" xmlns:sc="http://docs.oasis-open.org/ws-sx/ws-secureconversation/200512" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wst="http://schemas.xmlsoap.org/ws/2005/02/trust" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<trust:RequestType>http://docs.oasis-open.org/ws-sx/ws-trust/200512/Issue</trust:RequestType>
<wsp:AppliesTo>
<wsa:EndpointReference>
<wsa:Address>https://dss-test.nucrf.ru/SignServer/SignService.svc</wsa:Address>
</wsa:EndpointReference>
</wsp:AppliesTo>
<trust:TokenType>http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV1.1</trust:TokenType>
</trust:RequestSecurityToken>
</S:Body>
</S:Envelope>
</env:Body>
</env:Envelope>
Вопросы: 1. Что я делаю не так? 2. Spring-WS применим для клиента? 3. В сообщении не указаны логин и пароль. Они же должны быть?
|
|
|
|
Статус: Сотрудник
Группы: Участники
Зарегистрирован: 14.10.2011(UTC) Сообщений: 147 ![Мужчина Мужчина](/forum2/Themes/soclean/male.gif) Поблагодарили: 31 раз в 30 постах
|
Добрый день! 1. Во вложении пример запросов к STS и SignServer. Советую использовать конечную точку Active.svc/username/transport. 2. Если с его помощью можно получить сообщения, как в приложенных примерах, то да) 3. Да, должен быть UserNameToken в SOAP Header'e. ![](/forum2/Themes/soclean/icon_file.gif) Trace.zip (10kb) загружен 12 раз(а). |
|
|
|
|
Статус: Новичок
Группы: Участники
Зарегистрирован: 08.11.2016(UTC) Сообщений: 8
|
Спасибо. 1. Изменил endpoint на [http://dss.cryptopro.ru/STS/Active.svc/username/transport] 2. Добавил в запрос логин+пароль Код:<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
<env:Header>
<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" env:mustUnderstand="1">
<wsse:UsernameToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="XWSSGID-14786040328711022888936" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<wsse:Username>sms1</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">7</wsse:Password>
<wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">Wtg8xBeFDVXEN4NHP02uYdT6</wsse:Nonce>
<wsu:Created xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">2016-11-08T11:20:33Z</wsu:Created>
</wsse:UsernameToken>
<wsse:BinarySecurityToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3" wsu:Id="XWSSGID-14786040328671211138469" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">MIIDaTCCAlGgAwIBAgIEdPQV2zANBgkqhkiG9w0BAQsFADBlMQswCQYDVQQGEwJydTEQMA4GA1UECBMHVW5rbm93bjEMMAoGA1UEBxMDc3BiMQ0wCwYDVQQKEwRjcm9jMQwwCgYDVQQLEwNkaXQxGTAXBgNVBAMTEGFuZHJleSBsYXphcmVua28wHhcNMTYxMTA3MTU1NjQ2WhcNMTcwMjA1MTU1NjQ2WjBlMQswCQYDVQQGEwJydTEQMA4GA1UECBMHVW5rbm93bjEMMAoGA1UEBxMDc3BiMQ0wCwYDVQQKEwRjcm9jMQwwCgYDVQQLEwNkaXQxGTAXBgNVBAMTEGFuZHJleSBsYXphcmVua28wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCSl89FaZEViLPdXijciFTYbMFGzOk+VZQwkk/zS+X3Un+sqei5vc54p60jSd8ZGJveagW9Y/r5IrHNJqlb+JqA6Ld4JBEL1v8D3GPGbUk/Te2Q/ZtoMAZdnF3tMLXAMexWmv2incWP+it8Kq7yLlt2KcFztCkJeMlPboPw+/KimpUIS3vq1D96q6yPMose5f6YYxLum2aVYbtYUX1SB/MfAEAFG6ZAslfi6kVHzWRm2AN85/5QsX1l6hIVmaJC4ODvcRw8mOeZznbK3N7IUrpwPnnJyUMDnDK3fWlMplaMg6LFH5e87ZMiAr+U9CVulafVB5geYcP+thmm6iYWydazAgMBAAGjITAfMB0GA1UdDgQWBBRGdteEu0IfX120Ia8KV6NYX6WruzANBgkqhkiG9w0BAQsFAAOCAQEABF/FLfawnODdxsa+tmMH9n5GFjHd2uSv5ahGD3n1/UDuejizsNcUIBjpAjYQurYdkjp7rts2yiAzsN34Ay4dY3BQ3g3mKkArT4aKJvldryUcEMSNAcnbNk/SZ+GBAWF04AzmDm6bZR+7heFcunj7hrSHDiYtxPmQlHGdV/5ro3KEuBgkxrEXFL88tB2DoTg/s1FBoxVZGISnlZQl8O4b8cdfXAM4CoAVMAl3NJyhjBFaTju+vSAbovfaiCFajKu9qSVl/T3VFV6AJJeHEkiEb41SqXMs4qnP5rWJeXXxhW6LIGzxRgubfaYIh/esbXMAQzLPF0jBiSjsPEZ7BUyZsw==</wsse:BinarySecurityToken>
<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#" Id="XWSSGID-1478604032864-1552014484">
<ds:SignedInfo>
<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
<InclusiveNamespaces xmlns="http://www.w3.org/2001/10/xml-exc-c14n#" PrefixList="wsse env"/>
</ds:CanonicalizationMethod>
<ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
<ds:Reference URI="#XWSSGID-14786040331861403846532">
<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
<ds:DigestValue>oq+pGZW+6FcAjC/Xa32wHDByW1Y=</ds:DigestValue>
</ds:Reference>
</ds:SignedInfo>
<ds:SignatureValue>eoyB9R2x2NH2VJWDDVl4RpEq8ztGxTAxOi9YlZ6oF64NjT/tUCPKqx6H8sVK00uxjN68ySytP5AD
ft4cqP1YCt/pWiHgfocrkKiCc71ParZxoV15Wqsn2ulyZIM4dxuZ/7SYxSGVhngepbzw2VB21vTB
oJPfpWUUxPM9aI+CIJaU4vozU5+Y3j3eXb1jRFGYdz06WJQfwg5lrKRYE4RlGcEYu+zVvZInSkxm
CoNIxJz7g/MW58OSGedXMFo86CrmxAh3dWYTSDJc/70I72EZXAbk7r2CTPQXLp4RMrC0QGzWTX0L
kWhZuX9RV+Tk/RRVz9QLFQBRld/y7Esw4NpvsQ==</ds:SignatureValue>
<ds:KeyInfo>
<wsse:SecurityTokenReference xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="XWSSGID-1478604033173-1724227658" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<wsse:Reference URI="#XWSSGID-14786040328671211138469" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3"/>
</wsse:SecurityTokenReference>
</ds:KeyInfo>
</ds:Signature>
</wsse:Security>
</env:Header>
<env:Body xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="XWSSGID-14786040331861403846532">
<S:Envelope xmlns:S="http://www.w3.org/2003/05/soap-envelope">
<S:Body>
<trust:RequestSecurityToken xmlns:trust="http://docs.oasis-open.org/ws-sx/ws-trust/200512" xmlns:ns11="http://schemas.xmlsoap.org/ws/2006/02/addressingidentity" xmlns:ns12="http://www.w3.org/2000/09/xmldsig#" xmlns:ns13="http://docs.oasis-open.org/ws-sx/ws-trust/200802" xmlns:ns15="http://www.w3.org/2001/10/xml-exc-c14n#" xmlns:ns2="http://docs.oasis-open.org/wsfed/authorization/200706" xmlns:ns8="http://docs.oasis-open.org/wss/oasis-wss-wssecurity-secext-1.1.xsd" xmlns:ns9="http://docs.oasis-open.org/ws-sx/ws-trust/200512/" xmlns:sc="http://docs.oasis-open.org/ws-sx/ws-secureconversation/200512" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wst="http://schemas.xmlsoap.org/ws/2005/02/trust" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<trust:RequestType>http://docs.oasis-open.org/ws-sx/ws-trust/200512/Issue</trust:RequestType>
<wsp:AppliesTo>
<wsa:EndpointReference>
<wsa:Address>https://dss-test.nucrf.ru/SignServer/SignService.svc</wsa:Address>
</wsa:EndpointReference>
</wsp:AppliesTo>
<trust:TokenType>http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV1.1</trust:TokenType>
</trust:RequestSecurityToken>
</S:Body>
</S:Envelope>
</env:Body>
</env:Envelope>
Результат тот же: Обработка сообщения невозможно, так как действие "" недопустимо или нераспознано. Может быть что-то не так с текстом самого запроса? 1. Сам запрос неверно оформлен 2. Спринг при обработке подписи/аутентификации ломает запрос
|
|
|
|
Статус: Сотрудник
Группы: Участники
Зарегистрирован: 14.10.2011(UTC) Сообщений: 147 ![Мужчина Мужчина](/forum2/Themes/soclean/male.gif) Поблагодарили: 31 раз в 30 постах
|
Вы смотрели примеры запросов?
Как минимум: 1. Не хватает узла Action. 2. Тело запроса содержит лишние узлы Envelope и Body. |
|
|
|
|
Статус: Новичок
Группы: Участники
Зарегистрирован: 08.11.2016(UTC) Сообщений: 8
|
Коллеги, первая проблема похоже, что решена. итоги: получаю ответ User not found. Это уже гуд. 1. Подписывать сообщение не нужно. 2. Действительно спринг оборачивал готовое сообщение в еще один конверт, это плохо. 2. Запрос должен выглядеть так Код:<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
<env:Header>
<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" env:mustUnderstand="1">
<wsse:UsernameToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="XWSSGID-14786123520431409799125" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<wsse:Username>sms1</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">******</wsse:Password>
<wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">8wrN7SaNLiKLofov+pikNRcx</wsse:Nonce>
<wsu:Created xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">2016-11-08T13:39:12Z</wsu:Created>
</wsse:UsernameToken>
</wsse:Security>
<a:Action xmlns:a="http://www.w3.org/2005/08/addressing" env:mustUnderstand="true">http://docs.oasis-open.org/ws-sx/ws-trust/200512/RST/Issue</a:Action>
<a:MessageID xmlns:a="http://www.w3.org/2005/08/addressing">urn:uuid:a774c233-b248-4eff-be4a-6b0a0c32c160</a:MessageID>
<a:Address xmlns:a="http://www.w3.org/2005/08/addressing">http://www.w3.org/2005/08/addressing/anonymous</a:Address>
<a:ReplyTo xmlns:a="http://www.w3.org/2005/08/addressing">
<a:Address xmlns:a="http://www.w3.org/2005/08/addressing">http://www.w3.org/2005/08/addressing/anonymous</a:Address>
</a:ReplyTo>
<a:To xmlns:a="http://www.w3.org/2005/08/addressing" env:mustUnderstand="true">https://stenddss.cryptopro.ru/STS/Active.svc/username/transport</a:To>
</env:Header>
<env:Body>
<trust:RequestSecurityToken xmlns:trust="http://docs.oasis-open.org/ws-sx/ws-trust/200512">
<wsp:AppliesTo xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
<wsa:EndpointReference xmlns:wsa="http://www.w3.org/2005/08/addressing">
<wsa:Address>http://stenddss.cryptopro.ru/SignServer/SignService.svc</wsa:Address>
</wsa:EndpointReference>
</wsp:AppliesTo>
<trust:KeyType>http://docs.oasis-open.org/ws-sx/ws-trust/200512/SymmetricKey</trust:KeyType>
<trust:RequestType>http://docs.oasis-open.org/ws-sx/ws-trust/200512/Issue</trust:RequestType>
</trust:RequestSecurityToken>
</env:Body>
</env:Envelope>
|
|
|
|
Статус: Новичок
Группы: Участники
Зарегистрирован: 08.11.2016(UTC) Сообщений: 8
|
Коллеги, появился еще странный момент.
Скачал с сайта DSSWSTrustJava. Собрал и запустил.
Сообщение, что улетело, не содержит заголовка, но должно.
<?xml version='1.0' encoding='UTF-8'?> <S:Envelope xmlns:S="http://www.w3.org/2003/05/soap-envelope"> <S:Body> <trust:RequestSecurityToken xmlns:ns11="http://schemas.xmlsoap.org/ws/2006/02/addressingidentity" xmlns:ns12="http://www.w3.org/2000/09/xmldsig#" xmlns:ns13="http://docs.oasis-open.org/ws-sx/ws-trust/200802" xmlns:ns15="http://www.w3.org/2001/10/xml-exc-c14n#" xmlns:ns2="http://docs.oasis-open.org/wsfed/authorization/200706" xmlns:ns5="http://docs.oasis-open.org/wss/oasis-wss-wssecurity-secext-1.1.xsd" xmlns:ns7="http://docs.oasis-open.org/ws-sx/ws-trust/200512/" xmlns:sc="http://docs.oasis-open.org/ws-sx/ws-secureconversation/200512" xmlns:trust="http://docs.oasis-open.org/ws-sx/ws-trust/200512" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wst="http://schemas.xmlsoap.org/ws/2005/02/trust" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> <trust:RequestType>http://docs.oasis-open.org/ws-sx/ws-trust/200512/Issue</trust:RequestType> <wsp:AppliesTo> <wsa:EndpointReference> <wsa:Address>http://stenddss.cryptopro.ru/SignServer/SignService.svc</wsa:Address> </wsa:EndpointReference> </wsp:AppliesTo> <trust:TokenType>http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV1.1</trust:TokenType> </trust:RequestSecurityToken> </S:Body> </S:Envelope>
|
|
|
|
Статус: Сотрудник
Группы: Участники
Зарегистрирован: 14.10.2011(UTC) Сообщений: 147 ![Мужчина Мужчина](/forum2/Themes/soclean/male.gif) Поблагодарили: 31 раз в 30 постах
|
Можете показать, как инициализируете объект и вызываете метод Issue? |
|
|
|
|
Статус: Новичок
Группы: Участники
Зарегистрирован: 08.11.2016(UTC) Сообщений: 8
|
Да, конечно. Код:public class DSSWSTrustChannel {
private String appliesTo = "http://localhost/DssSignServer/SignService.svc";
private String stsNamespace
= "http://schemas.microsoft.com/ws/2008/06/identity/securitytokenservice";
private String stsPortName = "WS2007HttpBinding_IWSTrust13Sync";
private String stsServiceName = "SecurityTokenService";
private String stsEndpoint;
private String stsWSDLLocation;
Код:final DSSWSTrustChannel dsswsTrustChannel = createDSSWSTrustChannel();
dsswsTrustChannel.setCallbackHandler(new ConsoleOtpCallbackHandler());
dsswsTrustChannel.Issue();
Код: private DSSWSTrustChannel createDSSWSTrustChannel() {
final Properties properties = readProperties("Connection.properties");
final DSSWSTrustChannel dsswsTrustChannel = new DSSWSTrustChannel(properties.getProperty("stsEndpoint"));
dsswsTrustChannel.setAppliesTo(properties.getProperty("appliesTo"));
dsswsTrustChannel.setStsPortName(properties.getProperty("stsPortName"));
dsswsTrustChannel.setUserName(properties.getProperty("userName"));
dsswsTrustChannel.setPassword(properties.getProperty("userPass"));
dsswsTrustChannel.setStsWSDLLocation(properties.getProperty("stsEndpointWsdlLocation"));
return dsswsTrustChannel;
}
Код:
appliesTo=http://stenddss.cryptopro.ru/SignServer/SignService.svc
stsPortName=WS2007HttpBinding_IWSTrust13Sync
stsEndpoint=https://dss-test.nucrf.ru/STS/Active.svc/username/transport
stsEndpointWsdlLocation=https://dss-test.nucrf.ru/STS/Active.svc?wsdl
userName=User to sms2
userPass=***
|
|
|
|
Статус: Сотрудник
Группы: Участники
Зарегистрирован: 14.10.2011(UTC) Сообщений: 147 ![Мужчина Мужчина](/forum2/Themes/soclean/male.gif) Поблагодарили: 31 раз в 30 постах
|
Для начала смените имя порта с WS2007HttpBinding_IWSTrust13Sync на WS2007HttpBinding_IWSTrust13Sync3 |
|
|
|
|
Статус: Новичок
Группы: Участники
Зарегистрирован: 08.11.2016(UTC) Сообщений: 8
|
К сожалению не помогает: текст отправляемого запроса не меняется.
может быть потому что не указан getSTSNamespace?
|
|
|
|
Быстрый переход
Вы не можете создавать новые темы в этом форуме.
Вы не можете отвечать в этом форуме.
Вы не можете удалять Ваши сообщения в этом форуме.
Вы не можете редактировать Ваши сообщения в этом форуме.
Вы не можете создавать опросы в этом форуме.
Вы не можете голосовать в этом форуме.
Important Information:
The Форум КриптоПро uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close