简体   繁体   中英

Using java to upload a file to a Sharepoint Online repository authenticated by ADFS SSO?

I need to upload a file to a sharepoint online repository (Office 365). I need to do this in java and the sharepoint online site uses ADFS for single sign-on.

So far, all of the examples, sample-code, etc I've works for most of those requirements, but fails at one critical part (eg: java file upload with sso for a local sharepoint 2013 site, or java file upload to sharepoint online, but without the ADFS part). Authentication against ADFS seems to be one of the big sticking points.

Does anyone have an example of this working that meets all of those requirements?

edit-to-add: and, naturally, I've got no budget to do things like buy a commercial library that might do this quick-and-easy. :\\

The below are the steps you need to execute.

  1. Since you are trying to upload from JAVA, the only option SharePoint gives is REST API - I guess you are clear on this part.
  2. O365 identifies you(Java call) only if you send the auth token(SAML token) along with the Request body of your REST API call
  3. So you have to get the SAML token first and pass it with your REST Api call

Check out these links which explain the authentication process to O365 with ADFS.

Other thread in Stackoverflow Claim auth from ADFS

A blog post about getting auth in a windows 8 app. https://blogs.msdn.microsoft.com/omarv/2012/11/15/developing-windows-8-store-apps-for-sharepoint-online-with-sso-single-sign-on/

Only thing you have to do is, replace the C# parts with equivalent Java API calls.

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