OneDrive / onedrive-sdk-python

OneDrive SDK for Python! https://dev.onedrive.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

We're unable to complete your request invalid_request: The provided value for the input parameter 'redirect_uri' is not valid. The expected value is a URI which matches a redirect URI registered for this client application.

Dskpupper opened this issue · comments

I mentioned my redirect uri while registering and created id and password, but when i click the link i get this error msg in the browser .
2

image

What should be redirect_uri?
Im trying to connect my personal onedrive with this python code

This is the redirect uri im using
redirect_uri = 'http://localhost:8080/'

2nd method worked,

Hi,
I am in the same situation as you were and cannot pass the error page about reditect_uri.
I cannot see what is the 2nd method you mentioned, would mind sharing it with me please, it would help a lot.
Thank you

@ArnaudCampestre try using this code instead:

import onedrivesdk
from onedrivesdk.helpers import GetAuthCodeServer

redirect_uri = 'http://localhost:8080/'
client_secret = 'your_app_secret'
scopes=['wl.signin', 'wl.offline_access', 'onedrive.readwrite']

client = onedrivesdk.get_default_client(
    client_id='your_client_id', scopes=scopes)

auth_url = client.auth_provider.get_auth_url(redirect_uri)

#this will block until we have the code
code = GetAuthCodeServer.get_auth_code(auth_url, redirect_uri)

client.auth_provider.authenticate(code, redirect_uri, client_secret)

@KTibow Thank you very much for your help, it worked brilliantly.
Have a good one and thank you again