Closed ashish453 closed 4 years ago
What OS are you running on? First, if you're on Linux/Mac, sometimes running as root fixes this. What this means is that this was supposed to be for port 8080, but an application is already using that port. By the way, here's some better formatting for your issue: I am using Google Colab. I installed onedrive-sdk-python by doing:
pip install https://github.com/OneDrive/onedrive-sdk-python/archive/master.zip
And this is my authentication code:
import onedrivesdk
from onedrivesdk.helpers import GetAuthCodeServer
from onedrivesdk.helpers.resource_discovery import ResourceDiscoveryRequest
redirect_uri = 'http://localhost:8080'
client_id = "my client id"
client_secret = "my client secret"
discovery_uri = 'api.office.com/discovery'
auth_server_url = 'login.microsoftonline.com/common/oauth2/authorize'
auth_token_url = 'login.microsoftonline.com/common/oauth2/token'
http = onedrivesdk.HttpProvider()
auth = onedrivesdk.AuthProvider(http, client_id,
auth_server_url=auth_server_url,
auth_token_url=auth_token_url)
auth_url = auth.get_auth_url(redirect_uri)
code = GetAuthCodeServer.get_auth_code(auth_url, redirect_uri)
auth.authenticate(code, redirect_uri, client_secret, resource=discovery_uri)
And I got this error:
OSError Traceback (most recent call last)
in
code = GetAuthCodeServer.get_auth_code(auth_url, redirect_uri)
/usr/lib/python3.6/socketserver.py in server_bind(self)
self.socket.bind(self.server_address)
OSError: [Errno 98] Address already in use`
So how to solve it?
@Ashish45351 Is this your second account? Anyway, try running it as admin/root/sudo. Also try rebooting.
@ashish453 @Ashish45351 Can you close this? It clutters up everything.
I am using Google Colab. I installed onedrive-sdk-python by doing:
pip install https://github.com/OneDrive/onedrive-sdk-python/archive/master.zip
And this is my authentication code:And I got this error: