V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
different
V2EX  ›  Linux

关于 onedrive 的 api 调用

  •  
  •   different · 2019-07-20 19:00:35 +08:00 · 6884 次点击
    这是一个创建于 1733 天前的主题,其中的信息可能已经有所发展或是发生改变。

    想用 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 '[email protected]' 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 的可否告诉我一下这咋肥事....

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

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

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


    @xmoiduts 额,这语言没用过啊哈,所以还是找些我懂点皮毛的语言比较好
    dream10201
        12
    dream10201  
       2019-07-26 11:40:12 +08:00
    rclone 了解一下?
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5760 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 37ms · UTC 06:25 · PVG 14:25 · LAX 23:25 · JFK 02:25
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.