So I can get a SAML token now from our company NAM but can someone point me to a code example of how to use that token to authenticate my request using either web services OR the client object model?

I've been using the client object model more.

2 Answers 2


Please follow an article How to do active authentication to Office 365 and SharePoint Online to get acquainted how authentication in Office 365 works.

Regarding Security Token Service (STS) in Office 365:

In Office 365 the STS is located at https://login.microsoftonline.com/extSTS.srf. To request the token from the STS we pass the username and password using the SAML 1.1 protocol. If the authentication is successful the STS returns a security token. This security token is sent to SharePoint and if SharePoint successfully validates the token it will return two cookies (called FedAuth and rtFa). These two tokens must then be passed along with all requests to SharePoint.

The article also contains a code sample that demonstrates how to perform authentication in Office 365 including requesting SAML token. For details see getSamlToken method in MsOnlineClaimsHelper class


ADFS way : If You have this ready (identity provider), A SAML token-based authentication environment includes an identity provider security token service (IP-STS). The IP-STS issues SAML tokens on behalf of users whose accounts are included in the associated authentication provider. Tokens can include any number of claims about a user, such as a user name and the groups to which the user belongs. An Active Directory Federation Services (AD FS) 2.0 server is an example of an IP-STS.

If you have ADFS ,then PS:http://technet.microsoft.com/en-us/library/hh305235(v=office.15).aspx

2010 CODE way : Develop a custom authentication provider using WIF . Not sure about this in 2013 though

Your Answer

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

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