Sign up ×
Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute:

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:

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/

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):

Claim auth from ADFS

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.&#x000D;&#x000A;</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!

share|improve this question
    
This is a tricky one. Perhaps I've posted to the wrong place or not provided enough information. I love an actual example of the XML one would POST to Microsoft after authenticating with their internal ADFS. – JDM2 Jul 23 at 22:22

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.