我正在使用OneDrive Python与OneDrive交互,但是身份验证不起作用。当使用我的应用凭证在github页面上运行模板代码时,我可以在浏览器中验证应用程序,并将答案代码传递回我的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 SDKs页面执行示例程序。令人惊讶的是,这个代码/应用程序工作时没有问题。在我的理解中,唯一真正的区别是client_secret和client_id,它们的结构和内容也不一样。
例如,我的客户机ID是:3753a627-146e-4137-8f6e-8c561547551b,而示例中的客户机ID是:00000000481695BB
我不明白为什么秘密/id在结构上是不同的,为什么我的程序会失败,而这个例子却没有问题。
发布于 2021-11-15 22:46:40
确保您使用的是客户端值,而不是客户端机密ID。这是我的问题。
Azure秘密门户:

https://stackoverflow.com/questions/38078076
复制相似问题