title: Trying to get ADFS Saml assertion token using curl
body: <p>After reading this post <a href="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/" rel="noreferrer">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/</a></p>
  
  <p>I tried to request a SAML token using curl. </p>
  
  <p>Here is what I'm passing using curl:</p>
  
  <pre><code>curl https://server.com/adfs/services/trust/13/usernamemixed --data @request.txt -H "Content-Type:application/soap+xml"  --verbose -o "output.txt"
  </code></pre>
  
  <p>Here is my request.txt file</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;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"&gt;
      &lt;s:Header&gt;
          &lt;a:Action s:mustUnderstand="1"&gt;
  
  http://docs.oasis-open.org/ws-sx/ws-trust/200512/RST/Issue
  
          &lt;/a:Action&gt;
          &lt;a:To s:mustUnderstand="1"&gt;https://server.com/adfs/services/trust/13/UsernameMixed&lt;/a:To&gt;
          &lt;o:Security s:mustUnderstand="1" xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" &gt;
              &lt;o:UsernameToken u:Id="uuid-6a13a244-dac6-42c1-84c5-cbb345b0c4c4-1"&gt;
                  &lt;o:Username&gt;user&lt;/o:Username&gt;
                  &lt;o:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText"&gt;pass&lt;/o:Password&gt;
              &lt;/o:UsernameToken&gt;
          &lt;/o:Security&gt;
      &lt;/s:Header&gt;
      &lt;s:Body&gt;
          &lt;trust:RequestSecurityToken xmlns:trust="http://docs.oasis-open.org/ws-sx/ws-trust/200512"&gt;
              &lt;wsp:AppliesTo xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"&gt;
                  &lt;a:EndpointReference&gt;
                      &lt;a:Address&gt;https://server.com&lt;/a:Address&gt;
                  &lt;/a:EndpointReference&gt;
              &lt;/wsp:AppliesTo&gt;
              &lt;trust:KeyType&gt;http://docs.oasis-open.org/ws-sx/ws-trust/200512/Bearer&lt;/trust:KeyType&gt;
              &lt;trust:RequestType&gt;
  
  http://docs.oasis-open.org/ws-sx/ws-trust/200512/Issue
  
              &lt;/trust:RequestType&gt;
              &lt;trust:TokenType&gt;urn:oasis:names:tc:SAML:2.0:assertion&lt;/trust:TokenType&gt;
          &lt;/trust:RequestSecurityToken&gt;
      &lt;/s:Body&gt;
  &lt;/s:Envelope&gt;
  </code></pre>
  
  <p>The response I'm getting is MSIS3127: The specified request failed.</p>
  
  <p>Any ideas of things I can check? Thanks!</p>