none
Accessing sharepoint REST api using S2S authentication RRS feed

  • Question

  • Hi, I'm trying to access the SharePoint REST APIs (One-Drive for business) using the access token retrieved from S2S authentication flow (https://msdn.microsoft.com/en-us/library/azure/dn645543.aspx).

    Currently, I'm getting the following exception:

    he server was unable to process the request due to an internal error.  For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the <serviceDebug> configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework SDK documentation and inspect the server trace log

    Is this scenario (app auth instead of delegate auth) support for those set of APIs?

    Thanks


    Monday, March 9, 2015 7:12 AM

Answers

All replies

  • Hi,

    According to your description, my understanding is that you want to access SharePoint Online One-Drive for business API using OAuth 2.0 authentication.

    In summary, Rest API can work with OAuth 2.0 authentication.

    Here are some detailed articles about access Rest API with OAuth 2.0 authentication:

    OAuth 2.0 Compliant REST API

    Securing RESTful Web Services with OAuth2

    About accessing One-Drive for business with Rest API, you can refer the article below:

    Access OneDrive for Business using the SharePoint 2013 APIs

    About the error message, I suggest you can use Fiddler to track the web request to find detailed message:

    Fiddler

    Thanks

    Best Regards,

    Jerry Guo


    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    Tuesday, March 10, 2015 9:59 AM
  • Thanks for your response Jerry.

    I'm able to access one drive for business using delagate authentication. My question is if this API also support the service 2 service authentication.

    That is, directly retrieving the access token without user intervention.

    Thanks for your help,

    Liron

    Monday, March 16, 2015 10:17 AM
  • Hi,

    We are currently do deep research and will give you information later.

    Thanks for your understanding.

    Best Regards


    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    Wednesday, March 18, 2015 2:03 AM
  • HI guys, and update about this issue?

    Thanks,

    Liron

    Thursday, March 19, 2015 9:13 AM
  • Hi,

    If you want to use Service to Service authentication to get access token, you need to build the solution as SharePoint Provider hosted app.

    Here are some detailed articles for your reference:

    Context Token OAuth flow for apps in SharePoint 2013

    https://msdn.microsoft.com/en-us/library/office/jj687470.aspx

    Thanks

    Best Regards


    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    • Proposed as answer by Eric Tao Friday, April 3, 2015 1:48 AM
    • Marked as answer by Eric Tao Sunday, April 5, 2015 8:42 AM
    Friday, March 20, 2015 2:53 AM