简体   繁体   English

如何在Java for Sharepoint 2016中使用REST API进行身份验证?

[英]How to do authentication using REST API in Java for Sharepoint 2016?

We have a tenant server of Sharepoint. 我们有一个Sharepoint的租户服务器。 I need to upload a document on Sharepoint using Java? 我需要使用Java在Sharepoint上传文档吗?

I'm able to upload document using Advanced REST client after retriving X-RequestDigest value. 我可以在重新获取X-RequestDigest值后使用Advanced REST客户端上传文档。

But problem is that here I'm manually putting FedAuth, rtFa cookie from browser after logging through browser. 但问题是,我在这里通过浏览器手动从浏览器中输入FedAuth,rtFa cookie。

Please help me how to get these cookies programmatically using HTTP POST . 请帮助我如何使用HTTP POST以编程方式获取这些cookie。

休息客户

You need to get the X-RequestDigest FormDigestValue, which then will be the value used for the X-RequestDigest in every other POST call, with a POST call from http://whatever.com/YourSite/_api/contextinfo 你需要获得X-RequestDigest FormDigestValue,它将是每个其他POST调用中用于X-RequestDigest的值,来自http://whatever.com/YourSite/_api/contextinfo的POST调用

Edit: 编辑:
The value you get is your authentication which you have to use for every other POST call. 您获得的值是您必须用于每个其他POST调用的身份验证。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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