Python OneDrive SDK出现invalid_client错误

时间:2016-06-28 13:49:20

标签: python onedrive

我正在使用OneDrive Python SDK与OneDrive进行交互,但身份验证不起作用。运行模板代码时,使用我的应用凭据在github page上给出,我可以在浏览器中验证应用程序,并将答案代码传递回我的python程序。然后我收到一个错误,说客户无效。

127.0.0.1 - - [28/Jun/2016 15:34:42] "GET /?code=Mca303484-04b1-e70c-cfb4-7e902c7a4c9b HTTP/1.1" 200 -
Traceback (most recent call last):
  File "C:/Users/Tim/PycharmProjects/untitled/onedrive.py", line 27, in <module>
    main()
  File "C:/Users/Tim/PycharmProjects/untitled/onedrive.py", line 23, in main
    client.auth_provider.authenticate(code, redirect_uri, client_secret)
  File "C:\Users\Tim\AppData\Local\Programs\Python\Python35-32\lib\site-packages\onedrivesdk\auth_provider.py", line 169, in authenticate
    data=params)
  File "C:\Users\Tim\AppData\Local\Programs\Python\Python35-32\lib\site-packages\onedrivesdk\http_provider.py", line 71, in send
    custom_response = HttpResponse(response.status_code, response.headers, response.text)
  File "C:\Users\Tim\AppData\Local\Programs\Python\Python35-32\lib\site-packages\onedrivesdk\http_response.py", line 51, in __init__
    raise Exception(str(message["error"]))
Exception: invalid_client

我还尝试从One Drive Python SDKs GitHub page执行示例程序。令人惊讶的是,这个代码/应用程序没有问题。对我的理解,唯一真正的区别是client_secret和client_id,它们的结构也不同,而不仅仅是内容。

例如,我的客户ID为: 3753a627-146e-4137-8f6e-8c561547551b 示例中的客户端ID为: 00000000481695BB

我不明白为什么秘密/ id的结构不同以及我的程序失败的原因,而这个例子没有问题。

0 个答案:

没有答案