We have a SharePoint 2013 instance in the cloud. I am trying to figure out the ways we can write an application (be it web app, windows form, windows service) to either:

  1. Get a SAML token from a NAM site and pass it to the application so then it can use that token to hit the SharePoint Azure (cloud?) assets to manipulate them.

  2. Get a SAML token by passing credentials some other way.

Sadly, I am a very visual learner and complete code examples help me learn best but I have been hard pressed to find anything that makes a lot of sense or they are poorly documented.

Applications would be done in VS2013 using .NET and C#.

Can anyone help point me in the right direction? Even an example of sort of fudging it with providing a login and password to get the SAML token then using that token would be most helpful. We sadly have no one that really understands SharePoint 2013 online.

our sharepoint cloud environment I think, using MS federation authentication method at least when on our network as you don't need to supply a password just your log in name and it figures it out.

the apps we plan to run, would all be done internally on our network but those apps need to be able to communicate with sharepoint in the cloud.

1 Answer 1


You need to implement a Identity provider on your end and pass saml assertion (some kind of identifier) . Write code to convert to SAML1.1 token because Sharepoint does not understand SAML 2.0.So you need to write a code for this conversion.Then run the powershell scripts so that your web application can trust the claims. http://technet.microsoft.com/en-us/library/ff607753.aspx

  • do you really need to us powershell scripts in order to do this?
    – Bigbacon
    Commented Jul 24, 2014 at 19:20
  • yes , that will make the sharepoint to establish a trust with your custom STS ( web app, windows form, windows service).
    – Nikhil J
    Commented Jul 24, 2014 at 19:22
  • read this : sp77.blogspot.com/2014/02/…
    – Nikhil J
    Commented Jul 24, 2014 at 19:25
  • Also, we do have a ADFS server out there as well, is it possible to hit that and do the same thing? I've been messing with watching the requests in fiddler trying to see if I can send POSTS or GETS to try and get authentication information but not getting anywhere. Also when we sign in to sharepoint while on the network, we on't have to ut in an email address, no password, to get authenticated. I CAN'T pass credentials in my application which is why I am trying to mess with ADFS and/or the NAM I have seen that blog post but it doesn't help me without code examples.
    – Bigbacon
    Commented Jul 24, 2014 at 21:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.