Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running server.py results in exceptions.Auth0Error #18

Closed
secdec24 opened this issue May 23, 2017 · 1 comment
Closed

Running server.py results in exceptions.Auth0Error #18

secdec24 opened this issue May 23, 2017 · 1 comment

Comments

@secdec24
Copy link
Contributor

Steps to reproduce problem:

  1. Download sample project from Auth0 client (.env is already populated with correct client ID, domain, and secret).
  2. Add callback url to settings in Auth0 client.
  3. Create virtualenv and run pip install -r requirements.txt.
  4. Run python3 server.py and navigate to http://localhost:3000/
  5. Press SIGNIN button.

ERROR GET RESPONSE
http://localhost:3000/callback?error=access_denied&error_description=Service%20not%20found%3A%20%7BAPI_AUDIENCE%7D

ERROR
auth0.v3.exceptions.Auth0Error: invalid_request: Missing required parameter: code

TRACEBACK:

Traceback (most recent call last):
  File "/home/developer/.virtualenvs/auth0-starter-seed/lib/python3.5/site-packages/flask/app.py", line 1997, in __call__
    return self.wsgi_app(environ, start_response)
  File "/home/developer/.virtualenvs/auth0-starter-seed/lib/python3.5/site-packages/flask/app.py", line 1985, in wsgi_app
    response = self.handle_exception(e)
  File "/home/developer/.virtualenvs/auth0-starter-seed/lib/python3.5/site-packages/flask/app.py", line 1540, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/home/developer/.virtualenvs/auth0-starter-seed/lib/python3.5/site-packages/flask/_compat.py", line 33, in reraise
    raise value
  File "/home/developer/.virtualenvs/auth0-starter-seed/lib/python3.5/site-packages/flask/app.py", line 1982, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/developer/.virtualenvs/auth0-starter-seed/lib/python3.5/site-packages/flask/app.py", line 1614, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/developer/.virtualenvs/auth0-starter-seed/lib/python3.5/site-packages/flask/app.py", line 1517, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/home/developer/.virtualenvs/auth0-starter-seed/lib/python3.5/site-packages/flask/_compat.py", line 33, in reraise
    raise value
  File "/home/developer/.virtualenvs/auth0-starter-seed/lib/python3.5/site-packages/flask/app.py", line 1612, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/developer/.virtualenvs/auth0-starter-seed/lib/python3.5/site-packages/flask/app.py", line 1598, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/home/developer/Documents/auth0/00-starter-seed/server.py", line 64, in callback_handling
    AUTH0_CLIENT_SECRET, code, AUTH0_CALLBACK_URL)
  File "/home/developer/.virtualenvs/auth0-starter-seed/lib/python3.5/site-packages/auth0/v3/authentication/get_token.py", line 49, in authorization_code
    headers={'Content-Type': 'application/json'}
  File "/home/developer/.virtualenvs/auth0-starter-seed/lib/python3.5/site-packages/auth0/v3/authentication/base.py", line 11, in post
    return self._process_response(response)
  File "/home/developer/.virtualenvs/auth0-starter-seed/lib/python3.5/site-packages/auth0/v3/authentication/base.py", line 22, in _process_response
    message=text['error_description'])
auth0.v3.exceptions.Auth0Error: invalid_request: Missing required parameter: code
@Annyv2
Copy link
Contributor

Annyv2 commented May 23, 2017

Hi! You need to fill in the Audience in the .env file to avoid this error https://github.com/auth0-samples/auth0-python-web-app/blob/master/00-Starter-Seed/.env.example#L5. If you are not implementing any API you can use https://YOUR_DOMAIN.auth0.com/userinfo as the audience

@Annyv2 Annyv2 closed this as completed May 23, 2017
chenkie added a commit that referenced this issue May 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants