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

Django Auth Falliure #373

Open
abindent opened this issue Jun 17, 2022 · 0 comments
Open

Django Auth Falliure #373

abindent opened this issue Jun 17, 2022 · 0 comments

Comments

@abindent
Copy link

abindent commented Jun 17, 2022

Problem

When trying to use github auth in production it is setting hostname as http://localhost:300/ not the domain the app is using.

Traceback:

Environment:


Request Method: GET
Request URL: http://localhost:3000/api/auth/social/complete/github/?error=redirect_uri_mismatch&error_description=The+redirect_uri+MUST+match+the+registered+callback+URL+for+this+application.&error_uri=https%3A%2F%2Fdocs.github.com%2Fapps%2Fmanaging-oauth-apps%2Ftroubleshooting-authorization-request-errors%2F%23redirect-uri-mismatch&state=Pfdi1kVIAD04ULGUTvcorIedx5QDRq7e

Django Version: 4.0.4
Python Version: 3.8.13
Installed Applications:
['jazzmin',
 'django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.humanize',
 'django.contrib.messages',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.staticfiles',
 'anymail',
 'cloudinary',
 'compressor',
 'crispy_forms',
 'simpleinliner',
 'social_django',
 'home.apps.HomeConfig',
 'api.apps.ApiConfig',
 'member.apps.MemberConfig',
 'blog.apps.BlogConfig',
 'tools.apps.ToolsConfig',
 'search.apps.SearchConfig',
 'verify.apps.VerifyConfig']
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',
 'whitenoise.middleware.WhiteNoiseMiddleware']



Traceback (most recent call last):
  File "/home/gitpod/.pyenv/versions/3.8.13/lib/python3.8/site-packages/django/core/handlers/exception.py", line 55, in inner
    response = get_response(request)
  File "/home/gitpod/.pyenv/versions/3.8.13/lib/python3.8/site-packages/django/core/handlers/base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/gitpod/.pyenv/versions/3.8.13/lib/python3.8/site-packages/django/views/decorators/cache.py", line 62, in _wrapped_view_func
    response = view_func(request, *args, **kwargs)
  File "/home/gitpod/.pyenv/versions/3.8.13/lib/python3.8/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
    return view_func(*args, **kwargs)
  File "/home/gitpod/.pyenv/versions/3.8.13/lib/python3.8/site-packages/social_django/utils.py", line 46, in wrapper
    return func(request, backend, *args, **kwargs)
  File "/home/gitpod/.pyenv/versions/3.8.13/lib/python3.8/site-packages/social_django/views.py", line 31, in complete
    return do_complete(request.backend, _do_login, user=request.user,
  File "/home/gitpod/.pyenv/versions/3.8.13/lib/python3.8/site-packages/social_core/actions.py", line 45, in do_complete
    user = backend.complete(user=user, *args, **kwargs)
  File "/home/gitpod/.pyenv/versions/3.8.13/lib/python3.8/site-packages/social_core/backends/base.py", line 40, in complete
    return self.auth_complete(*args, **kwargs)
  File "/home/gitpod/.pyenv/versions/3.8.13/lib/python3.8/site-packages/social_core/utils.py", line 247, in wrapper
    return func(*args, **kwargs)
  File "/home/gitpod/.pyenv/versions/3.8.13/lib/python3.8/site-packages/social_core/backends/oauth.py", line 384, in auth_complete
    self.process_error(self.data)
  File "/home/gitpod/.pyenv/versions/3.8.13/lib/python3.8/site-packages/social_core/backends/oauth.py", line 376, in process_error
    raise AuthFailed(self, data.get('error_description') or

Exception Type: AuthFailed at /api/auth/social/complete/github/
Exception Value: Authentication failed: The redirect_uri MUST match the registered callback URL for this application.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant