Objective-C & WS-Trust : Faire une Request

MiKoMiKo Membre
juin 2015 modifié dans API UIKit #1

Salut à  tous !


 


Basé sur le tutoriel : http://leandrob.com/2012/02/request-a-token-from-adfs-using-ws-trust-from-ios-objective-c-iphone-ipad-android-java-node-js-or-any-platform-or-language/


 


J'essaie de créer une requête SOAP que j'envoie a un Serveur WCF avec WS-Trust. 


 


Ma requête est basé sur le tutoriel précédant mais je ne comprend pas comment le token dans la balise  <o:UsernameToken u:Id="XXX"> est défini ou comment puis-je le générer ?



<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:To s:mustUnderstand="1">http://127.0.0.1/SODIAPI/</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">
<o:UsernameToken u:Id="uuid-6a13a244-dac6-42c1-84c5-cbb345b0c4c4-1">
<o:Username>MY_LOGIN</o:Username>
<o:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">MY_PASSWORD</o:Password>
</o:UsernameToken>
</o:Security>
</s:Header>
<s: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">
<a:EndpointReference>
<a:Address>http://127.0.0.1/SODIAPI</a:Address>
</a:EndpointReference>
</wsp:AppliesTo>
<trust:KeyType>http://docs.oasis-open.org/ws-sx/ws-trust/200512/Bearer</trust:KeyType>
<trust:RequestType>http://docs.oasis-open.org/ws-sx/ws-trust/200512/Issue</trust:RequestType>
<trust:TokenType>urn:oasis:names:tc:SAML:2.0:assertion</trust:TokenType>
</trust:RequestSecurityToken>
<GetSystemId>
<designationString>ditech://CPH:023'AS1000'Calculated Values'Rsuz_0857</designationString>
</GetSystemId>
</s:Body>
</s:Envelope>

La Réponse du Serveur : BadContextToken -> The message could not be processed. This is most likely because the action 'http://tempuri.org/INamingService/GetSystemId' is incorrect or because the message contains an invalid or expired security context token or because there is a mismatch between bindings. The security context token would be invalid if the service aborted the channel due to inactivity. To prevent the service from aborting idle sessions prematurely increase the Receive timeout on the service endpoint's binding.


 


Je ne dispose d'aucun accès au serveur et n'ai quasiment aucune doc (en C# donc ca aide) excepté les WSDL des Services.


 


Merci par avance de votre aide.


 


MiKo


Mots clés:
Connectez-vous ou Inscrivez-vous pour répondre.