关于 onedrive 的 api 调用

2019-07-20 19:00:35 +08:00
 different

想用 onedrive 搭建一个个人网盘。

看了一些文档,好吧,当然技术不过关,基本没看懂。

于是乎,直接懒一点吧,用现成的程序,譬如:

oneindex.

https://github.com/donwa/oneindex

好了,开始了报错之路:

一开始用的是学校的邮箱:

绑定微软账号的时候提示:

error_description=AADSTS650051%3a+Using+application+'OneDrive+API'+is+currently+not+supported+for+your+organization+stu.xxxx.edu.cn+because+it+is+in+an+unmanaged+state.+An+administrator+needs+to+claim+ownership+of+the+company+by+DNS+validation+of+stu.xxx.edu.cn+before+the+application+OneDrive+API+can+be+provisioned.%0D%0ATrace+ID%3a+8fd3bb22-96d0-xxxxx-bd1a-9b97d95d6500%0D%0ACorrelation+ID%3a+ab213287-b2f8-xxxxxx-8d0b-b21943c714d2%0D%0ATimestamp%3a+2019-07-19+15%3a15%3a04Z

然后看样子是账号的管理员没有授权?

那就用自己的个人账号吧:

继续报错:

( OneDrive_SCF ):AADSTS50020: User account '7428xxx@qq.com' from identity provider 'live.com' does not exist in tenant '默认目录' and cannot access the application '298004f7-xxxxxx-4d56-aba3-b058c0154fd2'(OneDrive API) in that tenant. The account needs to be added as an external user in the tenant first. Sign out and sign in again with a different Azure Active Directory user account. ( oneIndex ) Authentication_MissingOrMalformed: Access Token missing or malformed.

看样子需要新建一个租户?:

然后绑定微软账号的时候,继续报错:

:e?error=access_denied&error_description=AADSTS650051%3a+Using+application+%27OneDrive+API%27+is+currently+not+supported+for+your+organization+lujiaxxx.com+because+it+is+in+an+unmanaged+state.+An+administrator+needs+to+claim+ownership+of+the+company+by+DNS+validation+of+lujianzxxxx.com+before+the+application+OneDrive+API+can+be+provisioned.%0d%0aTrace+ID%3a+5fce01ca-5b52-4a1d-xxxxxxx-8a37ec032000%0d%0aCorrelation+ID%3a+3611f686-xxxx-4299-811c-f314abdb3461%0d%0aTimestamp%3a+2019-07-20+09%3a42%3a10Z

想问一下谁用过 oneIndex 的可否告诉我一下这咋肥事....

6897 次点击
所在节点    Linux
12 条回复
gzxu
2019-07-20 23:05:37 +08:00
额,打个广告,虽然我自己也写了个 onedrive 客户端 https://github.com/gzxu/onedrive-sync-client,不过因为一些坑这里面也是不支持 organization account 的,只支持个人账号😅
gzxu
2019-07-20 23:06:11 +08:00
gzxu
2019-07-20 23:07:14 +08:00
好几个月没维护了,不知道还能不能用😅最近忙的事情比较多
Abbeyok
2019-07-20 23:34:05 +08:00
轮子那么多,合并自己造。
https://github.com/abbeyokgo/PyOne
xmoiduts
2019-07-21 05:07:10 +08:00
语言那个 onedrive 又不是不能用 /滑稽
xmoiduts
2019-07-21 05:07:44 +08:00
d 语言那个,之前用它同步过大量图片,往返于本机和 vps。
geelaw
2019-07-21 07:31:57 +08:00
看起来你总是在尝试用 Business 版本,第一个、第三个错误是因为该域名不属于任何一个 tenant,第二个错误是因为你尝试在一个特定的 tenant 里面用 Microsoft account,但是该 tenant 没有把这个 MSA 加为外部用户。

解决方法是理解 oneindex 在干什么,然后让它访问正确的 Personal 版本而不是 Business 版本。
ETiV
2019-07-21 08:22:05 +08:00
Linux ?又想起了三家操作系统对比的段子了…
different
2019-07-21 13:11:08 +08:00
@geelaw 第三个错误,是在我的个人账户上的开的一个外部账户...,所以他的 tenant 应该是我个人账号才对,那么这样子为啥还报错?
different
2019-07-21 13:11:17 +08:00
@ETiV
different
2019-07-21 13:15:30 +08:00
@gzxu 非常感谢,但我需要的应该是一个网页个人网盘。

@Abbeyok 造轮子就尴尬了,一方面没有能力,一方面没有时间呀,并且出问题了还要自己经常维护,所以还是比较倾向于一些开源的长期维护的版本。


@xmoiduts 额,这语言没用过啊哈,所以还是找些我懂点皮毛的语言比较好
dream10201
2019-07-26 11:40:12 +08:00
rclone 了解一下?

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/584726

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX