CRM Online 2015 Authentication Raw Soap <p>Hi and thanks for taking this time to look,</p> <p>I've recently been asked to investigate integration using CRM Online 2015, I've come across some issues trying to Authenticate using Raw SOAP requests.</p> <p>While I know there's other ways to authenticate, predominantly the using the CRM SDK, my iron will is pushing me to find a solution using Raw SOAP.</p> <p>I came across a very helpful blog by Jason Lattimer: <a href="http://jlattimer.blogspot.co.uk/2015/02/soap-only-authentication-using-c.html" rel="nofollow">http://jlattimer.blogspot.co.uk/2015/02/soap-only-authentication-using-c.html</a></p> <p>Following this sample, I successfully authenticated with a Trial CRM account using RAW SOAP... Great... Done... I was wrong.</p> <p>As soon as I pointed this sample at the CRM development environment I got a SOAP error:</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: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" xmlns:wst="http://schemas.xmlsoap.org/ws/2005/02/trust" xmlns:psf="http://schemas.microsoft.com/Passport/SoapServices/SOAPFault"&gt; &lt;S:Body&gt; &lt;S:Fault&gt; &lt;S:Code&gt; &lt;S:Value&gt;S:Sender&lt;/S:Value&gt; &lt;S:Subcode&gt; &lt;S:Value&gt;wst:FailedAuthentication&lt;/S:Value&gt; &lt;/S:Subcode&gt; &lt;/S:Code&gt; &lt;S:Reason&gt; &lt;S:Text xml:lang="en-US"&gt;Authentication Failure&lt;/S:Text&gt; &lt;/S:Reason&gt; &lt;S:Detail&gt; &lt;psf:error&gt; &lt;psf:value&gt;0x80048821&lt;/psf:value&gt; &lt;psf:internalerror&gt; &lt;psf:code&gt;0x80047860&lt;/psf:code&gt; &lt;psf:text&gt;Direct login to WLID is not allowed for this federated namespace&lt;/psf:text&gt; &lt;/psf:internalerror&gt; &lt;/psf:error&gt; &lt;/S:Detail&gt; &lt;/S:Fault&gt; &lt;/S:Body&gt; &lt;/S:Envelope&gt; </code></pre> <p>The only difference I can think between the Trial version which worked and the development environment is that the development environment setup uses ADFS / AD On-Premises.</p> <p>Fiddler logs show that Jason's Sample goes straight to login.microsoftonline.com whereas CRM SDK (which works) goes to dynamicscrmemea.accesscontrol.windows.net.</p> <p>So I believe this is the problem area!</p> <p>I've been around in circles on stack overflow/other sources, I have a feeling it will a relatively small change required to the SOAP request but I've reached the point where I need some fresh eyes/advice.</p> <p>Has anyone had experience with this setup? Can anyone gently push me in the right direction?</p> <p>Many Thanks</p> <p>Gareth</p>