Oauth2 for SharePoint 365 REST

后端 未结 4 1307
鱼传尺愫
鱼传尺愫 2021-02-02 01:44

I\'m trying to connect to Sharepoint Online (Sharepoint 365?) content using OAuth2 and the REST API. I need to do this from Python as it is an addition to an existing applicati

4条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-02 02:13

    I've successfully connected to SharePoint Online using PHP. It looks to me like you're combining two different methods to do so. Here is what I did:

    • Register my app in Azure AD on the Management Portal to get client_id, client_secret, redirectUri and the right permissions on Office 365 for sites.
    • Call the authorization endpoint at https://login.microsoftonline.com/common/oauth2/authorize
    • Call the token service endpoint at https://login.microsoftonline.com/common/oauth2/token
    • Call the SharePoint REST endpoint with the access token.
    • The resource should be simply the URL of your SharePoint site.

    The appregnew.aspx and appprincipals.aspx pages are used for apps for SharePoint but it doesn't look like you're building one.

提交回复
热议问题