auth0-python-web-app icon indicating copy to clipboard operation
auth0-python-web-app copied to clipboard

Flask example broken

Open koaning opened this issue 3 years ago • 1 comments

The tutorial seems broken, I keep hitting this error when I run python server.py.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/vincentwarmerdam/Development/auth0-python-fastapi-sample/venv/lib/python3.8/site-packages/flask/app.py", line 2525, in wsgi_app
    response = self.full_dispatch_request()
  File "/Users/vincentwarmerdam/Development/auth0-python-fastapi-sample/venv/lib/python3.8/site-packages/flask/app.py", line 1822, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/Users/vincentwarmerdam/Development/auth0-python-fastapi-sample/venv/lib/python3.8/site-packages/flask/app.py", line 1820, in full_dispatch_request
    rv = self.dispatch_request()
  File "/Users/vincentwarmerdam/Development/auth0-python-fastapi-sample/venv/lib/python3.8/site-packages/flask/app.py", line 1796, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
  File "server.py", line 40, in login
    return oauth.auth0.authorize_redirect(
  File "/Users/vincentwarmerdam/Development/auth0-python-fastapi-sample/venv/lib/python3.8/site-packages/authlib/integrations/flask_client/apps.py", line 46, in authorize_redirect
    rv = self.create_authorization_url(redirect_uri, **kwargs)
  File "/Users/vincentwarmerdam/Development/auth0-python-fastapi-sample/venv/lib/python3.8/site-packages/authlib/integrations/base_client/sync_app.py", line 309, in create_authorization_url
    metadata = self.load_server_metadata()
  File "/Users/vincentwarmerdam/Development/auth0-python-fastapi-sample/venv/lib/python3.8/site-packages/authlib/integrations/base_client/sync_app.py", line 294, in load_server_metadata
    resp = session.request('GET', self._server_metadata_url, withhold_token=True)
  File "/Users/vincentwarmerdam/Development/auth0-python-fastapi-sample/venv/lib/python3.8/site-packages/authlib/integrations/requests_client/oauth2_session.py", line 104, in request
    return super(OAuth2Session, self).request(
  File "/Users/vincentwarmerdam/Development/auth0-python-fastapi-sample/venv/lib/python3.8/site-packages/requests/sessions.py", line 587, in request
    resp = self.send(prep, **send_kwargs)
  File "/Users/vincentwarmerdam/Development/auth0-python-fastapi-sample/venv/lib/python3.8/site-packages/requests/sessions.py", line 701, in send
    r = adapter.send(request, **kwargs)
  File "/Users/vincentwarmerdam/Development/auth0-python-fastapi-sample/venv/lib/python3.8/site-packages/requests/adapters.py", line 565, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='none', port=443): Max retries exceeded with url: /.well-known/openid-configuration (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x104816490>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known'))

I'm using Python 3.8.9 with the requirements.txt provided in this repo.

koaning avatar Aug 31 '22 10:08 koaning

Hey @koaning, Can you verify that the value for AUTH0_DOMAIN is provided .env? Looks like that could be causing the issue.

poovamraj avatar Aug 31 '22 16:08 poovamraj

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you have not received a response for our team (apologies for the delay) and this is still a blocker, please reply with additional information or just a ping. Thank you for your contribution! 🙇‍♂️

stale[bot] avatar Jan 08 '23 04:01 stale[bot]

Closing this issue based on inactivity, please ping to reopen if you'd like to continue the discussion.

ewanharris avatar Mar 29 '23 14:03 ewanharris

I'm having the same issue. Not sure if this was ever solved. AUTH0_DOMAIN is provided in the .env file.

shashwatdreams avatar Jul 09 '23 23:07 shashwatdreams