Many enterprises who use Sharepoint Online leverage the Office 365 integration with an on-premise ADFS. That way they can have the benefit of having Sharepoint on the cloud, but while being able to still use their existing Active Directory for sign in without having to maintain duplicate accounts. See https://support.office.com/en-us/article/Office-365-integration-with-on-premises-environments-263faf8d-aa21-428b-aed3-2021837a4b65 for more information.
I have a service account set up in ADFS that is synced to Sharepoint Online and now I would like to call the Sharepoint web services using this account.
I am already able to call REST/SOAP web services for the following two setups:
For Sharepoint on premise, you can simply use Form-based authentication with username/password/domain of the service account in the ADFS (also on-premise) to get authenticated.
For native office 365 service account, it's a little more complex.
- Using the Office 365 service account username/password, you do a handshake with https://{tenant}.sharepoint.com/_forms/default.aspx?wa=wsignin1.0
- The handshake generates an rtfa cookie, fedAuth cookie and the FormDigestValue.
- You specify the cookies and digest as headers in the request and you are able to authenticate with Sharepoint online.
What is the process for authenticating for API calls when we have the Sharepoint online synced with an on-premise ADFS setup?