问题
I am using the OneDrive Python SDK to interact with OneDrive, however the authentification doesn`t work. When running the template code give on the github page with my app credentials, i can authentificate the app in the browser and the answer-code gets passed back to my python programm. Then i get an error, saying invalid client.
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
I also tried executing the example programm, from the One Drive Python SDKs GitHub page. Surprisingly this code/app works without a problem. To my understading, the only real differences are the client_secret and the client_id, which also differ in structure and not just in content.
For example, my client ID is: 3753a627-146e-4137-8f6e-8c561547551b while the client ID in the example is: 00000000481695BB
I don`t understand why the secret/id are different in structure and why my programm fails, while the example works without a problem.
来源:https://stackoverflow.com/questions/38078076/invalid-client-error-with-python-onedrive-sdk