OneDrive / onedrive-sdk-python

OneDrive SDK for Python! https://dev.onedrive.com
MIT License
1.08k stars 189 forks source link

LocalHost refuse to connect #190

Closed acmilannesta closed 3 weeks ago

acmilannesta commented 3 years ago

Hi,

I'm trying to OAuth2 and set up redirect URL as following: image

Here is my code:

import onedrivesdk_fork as onedrivesdk
redirect_uri = 'http://localhost:8080/'
client_secret = 'xxxx'
client_id = 'xxxx'
api_base_url='https://api.onedrive.com/v1.0/'
scopes=['wl.signin', 'wl.offline_access', 'onedrive.readwrite']

http_provider = onedrivesdk.HttpProvider()
auth_provider = onedrivesdk.AuthProvider(
    http_provider=http_provider,
    client_id=client_id,
    scopes=scopes)

client = onedrivesdk.OneDriveClient(api_base_url, auth_provider, http_provider)
auth_url = client.auth_provider.get_auth_url(redirect_uri)
print(auth_url)

But once I click the auth_url and select "yes" to allow access of all the scopes. Then the localhost refuse to connect.

KTibow commented 3 years ago

sighs Vague descriptions never help in an issue. Please give a more exact error, and a screenshot.

acmilannesta commented 3 years ago

Yes, I just try to automate file uploads to my OneDrive. So when I try to access my account, the authentication page should be direct to the "auth_url" right, but it fails to connect after I click it.

https://login.live.com/oauth20_authorize.srf?client_id=6d2489de-a647-47f2-8c46-2c9b2fa113da&response_type=code&redirect_uri=http%3A%2F%2Flocalhost%3A8080%2F&scope=wl.signin+wl.offline_access+onedrive.readwrite

And shows the following image

KTibow commented 3 years ago

Did you see the example base codes? Do any of them work?

baywet commented 3 weeks ago

Thank you for reaching out and for your patience. This SDK is being officially deprecated. See #209 for more information