简体   繁体   English

使用HttpClient进行UWP OneDrive访问(WebDav命令)

[英]UWP OneDrive access with HttpClient (WebDav commands)

I'm trying to figure out, how the the Access to OneDrive works, when adding a netshare on my Windows 10 PC with the "WebDav" URI ( https://d.docs.live.net/CustomerID ). 我正在尝试在Windows 10 PC上使用“ WebDav” URI( https://d.docs.live.net/CustomerID )添加网络共享时,访问OneDrive的工作方式。 So it seems that basically the Access works with WebDav commands, but the authentication seems to be with Microsoft Passport. 因此,似乎Access基本上可以与WebDav命令一起使用,但是身份验证似乎与Microsoft Passport一起使用。 Now inside my UWP test app i can Access WebDav Servers with Basic and Digest authentication, but i can't Access OneDrive. 现在,在我的UWP测试应用程序中,我可以访问具有基本身份验证和摘要式身份验证的WebDav服务器,但不能访问OneDrive。 What exactly do i need to implement, to authenticate with OneDrive? 我到底要实现什么才能通过OneDrive进行身份验证?

Thanks in advice 谢谢建议

I'd suggest checking out the OneDrive SDK - it has samples that include authentication. 我建议您检查一下OneDrive SDK-它具有包含身份验证的示例。 Alternatively, since you're writing a UWP you could consider the UWP Community Toolkit that has OneDrive support via UWP file-like interfaces. 另外,由于您正在编写UWP,因此可以考虑通过类似UWP文件的界面具有OneDrive支持的UWP社区工具包

After a lot of testing, i figured out, how to retreive an access token for sending webdav-requests to onedrive, which works the same way, as a connected network share to onedrive in windows does. 经过大量测试,我发现如何获取访问令牌以将webdav请求发送到onedrive,其工作方式与Windows中连接到onedrive的已连接网络共享相同。 Fiddler helped me to understand the process of authentication. 提琴手帮助我了解了身份验证的过程。

Thanks for all the answers. 感谢所有的答案。

Best Regards 最好的祝福

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

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