Imagine a console app written in any language using plain old HTTP and XML strings to interact with Office 365 SharePoint.
Authentication is where I'm having troubles.
Because this is a business account, there is an on premise ADFS server which must be queried first. The mechanism works as the very kind Leandro Boffi describes here:
Step 2 is to extract the Assertion from the above response and post it up to Microsoft's Security Token Service (https://login.microsoftonline.com/extSTS.srf) as described here (bottom answer):
This is where I'm a bit lost. What exactly is the Assertion? Is it the entire hunk of XML between the
<trust:RequestedSecurityToken...> </trust:RequestedSecurityToken>
elements that I get back from ADFS?
If so, when I put that hunk of xml into the template specified in stackoverflow answer, I get the following error from Microsoft:
<psf:error>
<psf:value>0x800488fc</psf:value>
<psf:internalerror>
<psf:code>0x80045c17</psf:code>
<psf:text>WebSSO invalid assertion.
</psf:text>
</psf:internalerror>
</psf:error>
and that's all she wrote...
Has anybody actually gotten this stuff to work? I'd love to see the actual XML strings being posted to ADFS and then to MS STS. I believe if I could just format the MS STS XML correctly, I'd be able to extract the values that will become cookies in all subsequent http requests and happily use the SharePoint REST API from then on!
Thanks in advance!