Auth0 Home Blog Docs

Django SDK quickstart: HTTPError at /complete/auth0

Hello,
I’m trying to use auth0 with Django. I have downloaded the sample with my credentials.
The application runs, I log with auth0 and then there is an error:

HTTPError at /complete/auth0
403 Client Error: Forbidden for url: https://fiveteam.eu.auth0.com/oauth/token

with the following details:

Environment:

Request Method: GET
Request URL: http://8b9df93fe8fe4d55bdf397566b701ee7.vfs.cloud9.us-east-2.amazonaws.com:80/complete/auth0?redirect_state=5ELYBUXrjokv6AXjTwdPmMPTeWF6H7wh&code=sDyogqcmUKHH5Q5A&state=5ELYBUXrjokv6AXjTwdPmMPTeWF6H7wh

Django Version: 2.1.9
Python Version: 3.6.8
Installed Applications:
['django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'social_django',
 'auth0login']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware']



Traceback:

File "/home/ec2-user/environment/env/lib64/python3.6/dist-packages/django/core/handlers/exception.py" in inner
  34.             response = get_response(request)

File "/home/ec2-user/environment/env/lib64/python3.6/dist-packages/django/core/handlers/base.py" in _get_response
  126.                 response = self.process_exception_by_middleware(e, request)

File "/home/ec2-user/environment/env/lib64/python3.6/dist-packages/django/core/handlers/base.py" in _get_response
  124.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/home/ec2-user/environment/env/lib64/python3.6/dist-packages/django/views/decorators/cache.py" in _wrapped_view_func
  44.         response = view_func(request, *args, **kwargs)

File "/home/ec2-user/environment/env/lib64/python3.6/dist-packages/django/views/decorators/csrf.py" in wrapped_view
  54.         return view_func(*args, **kwargs)

File "/home/ec2-user/environment/env/lib64/python3.6/dist-packages/social_django/utils.py" in wrapper
  49.             return func(request, backend, *args, **kwargs)

File "/home/ec2-user/environment/env/lib64/python3.6/dist-packages/social_django/views.py" in complete
  33.                        *args, **kwargs)

File "/home/ec2-user/environment/env/lib64/python3.6/dist-packages/social_core/actions.py" in do_complete
  43.         user = backend.complete(user=user, *args, **kwargs)

File "/home/ec2-user/environment/env/lib64/python3.6/dist-packages/social_core/backends/base.py" in complete
  40.         return self.auth_complete(*args, **kwargs)

File "/home/ec2-user/environment/env/lib64/python3.6/dist-packages/social_core/utils.py" in wrapper
  251.             return func(*args, **kwargs)

File "/home/ec2-user/environment/env/lib64/python3.6/dist-packages/social_core/backends/oauth.py" in auth_complete
  401.             method=self.ACCESS_TOKEN_METHOD

File "/home/ec2-user/environment/env/lib64/python3.6/dist-packages/social_core/backends/oauth.py" in request_access_token
  373.         return self.get_json(*args, **kwargs)

File "/home/ec2-user/environment/env/lib64/python3.6/dist-packages/social_core/backends/base.py" in get_json
  238.         return self.request(url, *args, **kwargs).json()

File "/home/ec2-user/environment/env/lib64/python3.6/dist-packages/social_core/backends/base.py" in request
  234.         response.raise_for_status()

File "/home/ec2-user/environment/env/lib64/python3.6/dist-packages/requests/models.py" in raise_for_status
  940.             raise HTTPError(http_error_msg, response=self)

Exception Type: HTTPError at /complete/auth0
Exception Value: 403 Client Error: Forbidden for url: https://fiveteam.eu.auth0.com/oauth/token

I don’t understand what I’m doing wrong, I have only updated one thing: the ALLOWED_HOSTS in the settings.py, as I work with aws cloud9.
Thanks for your help.