Office 365 Login / Sharepoint Online

I am writing a WCF service hosted on Azure as (PaaS). The service, in turn, should talk to Sharepoint 2013 Online / Office 365.

I searched for using the SharePoint object model to talk to him, but I continue to get the following error: "The remote server responded with an error: (403) Forbidden" When we log in to access the SharePoint instance through a browser, you can usually go to https: //login.microsoftonline.com/login.srf so you can log in using Live Id. The problem is that we are using a federated account, not a Live Id, and so we redirect the adfs site again to log in. I looked at the sample code at http://www.wictorwilen.se/Post/How-to-do-active-authentication-to-Office-365-and-SharePoint-Online.aspx , which uses claims-based authentication, but this always fails with the message “Authentication Error” when trying to restore the Samlen Token.

If I understand this correctly. One way to do this is to get the Saml token, pass it an SPO, which in turn will return two cookies, which I need to include in requests made with the client object model. The problem is that I cannot find suitable examples of how to authenticate using a federated account in C #.

Can someone point me in the right direction, how can I continue authorizing the WCF service to talk to SharePoint.

Sorry if this is the wrong forum. I'm not quite sure if this is an Azure problem or just SharePoint, as I'm pretty new to both technologies.

+44
authentication c # sharepoint sharepoint-2013
Nov 21 '12 at 9:22
source share
6 answers

Try the following blog article. The ability to access the Office 365 API was announced only last month, and the ability to call this from your web service is fairly new. This article is a good tutorial on this.

+1
Apr 16 '14 at 12:29
source share

Hi, just in case, when we registered as an Office365 reseller a few days ago, I had to study one sick limit: auth. The token you receive from sharepoint is valid for only 2 hours! Perhaps this will change in Sharepoint 15, which knows ...

I thought this could be a valuable hint because there is no unknown workaround ...

0
Dec 14 '12 at 22:15
source share

Have you tried using the Wictor example code and simply replaced the login.srf URL with your ADFS login endpoint?

Keep the script open when you try this, and check the requests / answers every time, you will probably see more detailed information on why things do not work in the response body, which C # hides in its object model.

Also check out this blog post on how to get the auth token from ADFS using anything where you can create a SOAP envelope:

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 /

0
Dec 18 '12 at 11:44
source share

I know this is an old post, but using SharePoint Online through an application without using the application principal may violate your license agreement. You must use true OAuth and the TokenHelper class, which is part of the SDK, in order to properly use the application model.

0
Dec 09 '13 at 19:45
source share

Use the Office 365 SharePoint site to create an environment in which you can use ACS to establish trust between the provider-hosted application and the on-premises SharePoint 2013 farm, just as if you were developing applications for the Office 365 SharePoint site. You can visit the following link for further understanding: http://msdn.microsoft.com/en-us/library/office/dn155905(v=office.15).aspx

0
Mar 07 '14 at 1:55
source share

I was getting 403 trying to do the same with the SharePoint object model. All I had to do to fix this was to enable the user agent.

The answer is here Using WebRequest to receive cookies to automatically log into Sharepoint Online, receive varour errors

Hope this helps.

0
Apr 21 '14 at 20:28
source share



All Articles