Skip to content
This repository has been archived by the owner on Oct 2, 2024. It is now read-only.

LocalHost refuse to connect #190

Closed
acmilannesta opened this issue Apr 19, 2021 · 4 comments
Closed

LocalHost refuse to connect #190

acmilannesta opened this issue Apr 19, 2021 · 4 comments

Comments

@acmilannesta
Copy link

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
Copy link

KTibow commented Apr 20, 2021

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

@acmilannesta
Copy link
Author

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
Copy link

KTibow commented Apr 20, 2021

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

@baywet
Copy link
Member

baywet commented Oct 2, 2024

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

@baywet baywet closed this as not planned Won't fix, can't repro, duplicate, stale Oct 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants