简体   繁体   中英

SP Online REST API Issue when uses AZURE Access token

My requirement is described below.

  1. User uploads the document through web-app and document saves in to shared location.
  2. Application service (cron job or server code) , selects the documents and extracts the details.
  3. Cron job send the details to SharePoint rest api which is protected by azure AD. (Oauth protocol)

I have a valid AZURE client ID and Secret ID which has application level access permission. I got access token by using AZURE client ID and Secret ID from AZURE AD with help of simple JAVA code but am getting following error when i call sharepoint online REST service using Oauth access token.

Error : {"error_description":"Exception of type 'Microsoft.IdentityModel.Tokens.AudienceUriValidationFailedException' was thrown."}

What does it mean? Can anyone help me resolve the issue ?

As SharePoint Online has strict safety standards, authentication for working with REST API consists of three steps:

1.Get the security token from Microsoft authentication portal.

2.Get the cookies from the SharePoint Online server.

3.Get the signature for requests to the SharePoint Online server.

More information is here: http://www.wave-access.com/public_en/blog/2015/june/23/java-service-integration-with-sharepoint-online-via-rest-api.aspx

Access Office 365 from JAVA, we can use Office 365 SDKs for Java.

https://github.com/OfficeDev/Office-365-SDK-for-Java

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM