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

keycloak auth issue #3406

Open
lgwapnitsky opened this issue Nov 20, 2024 · 0 comments
Open

keycloak auth issue #3406

lgwapnitsky opened this issue Nov 20, 2024 · 0 comments

Comments

@lgwapnitsky
Copy link

Tandoor Version

1.5.2

Setup

Manual Setup

Reverse Proxy

Others (please state below)

Other

nginx

Bug description

unable to log in with keycloak. Whenever I try, I receive errors. See following debug page

Relevant logs

Environment:


Request Method: POST
Request URL: https://recipes.REDACTED.com/accounts/oidc/keycloak/login/?process=login&next=%2Fsearch%2F

Django Version: 4.2.16
Python Version: 3.11.2
Installed Applications:
['django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.sites',
 'django.contrib.staticfiles',
 'django.contrib.postgres',
 'oauth2_provider',
 'django_tables2',
 'corsheaders',
 'crispy_forms',
 'crispy_bootstrap4',
 'rest_framework',
 'rest_framework.authtoken',
 'django_cleanup.apps.CleanupConfig',
 'webpack_loader',
 'django_js_reverse',
 'hcaptcha',
 'allauth',
 'allauth.account',
 'allauth.socialaccount',
 'cookbook.apps.CookbookConfig',
 'treebeard',
 'allauth.socialaccount.providers.openid_connect',
 'debug_toolbar']
Installed Middleware:
['corsheaders.middleware.CorsMiddleware',
 'django.middleware.security.SecurityMiddleware',
 'whitenoise.middleware.WhiteNoiseMiddleware',
 '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.locale.LocaleMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware',
 'cookbook.helper.scope_middleware.ScopeMiddleware',
 'allauth.account.middleware.AccountMiddleware',
 'debug_toolbar.middleware.DebugToolbarMiddleware']



Traceback (most recent call last):
  File "/var/www/recipes/lib/python3.11/site-packages/django/core/handlers/exception.py", line 55, in inner
    response = get_response(request)
               ^^^^^^^^^^^^^^^^^^^^^
  File "/var/www/recipes/lib/python3.11/site-packages/django/core/handlers/base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/www/recipes/lib/python3.11/site-packages/allauth/socialaccount/providers/openid_connect/views.py", line 69, in login
    return view(request)
           ^^^^^^^^^^^^^
  File "/var/www/recipes/lib/python3.11/site-packages/allauth/socialaccount/providers/oauth2/views.py", line 87, in view
    return self.dispatch(request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/www/recipes/lib/python3.11/site-packages/allauth/socialaccount/providers/base/mixins.py", line 10, in dispatch
    return self.login(request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/www/recipes/lib/python3.11/site-packages/allauth/socialaccount/providers/oauth2/views.py", line 116, in login
    client = self.get_client(request, app)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/www/recipes/lib/python3.11/site-packages/allauth/socialaccount/providers/oauth2/views.py", line 102, in get_client
    self.adapter.access_token_url,
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/www/recipes/lib/python3.11/site-packages/allauth/socialaccount/providers/openid_connect/views.py", line 39, in access_token_url
    return self.openid_config["token_endpoint"]
           ^^^^^^^^^^^^^^^^^^
  File "/var/www/recipes/lib/python3.11/site-packages/allauth/socialaccount/providers/openid_connect/views.py", line 24, in openid_config
    resp.raise_for_status()
    ^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/www/recipes/lib/python3.11/site-packages/requests/models.py", line 1024, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Exception Type: HTTPError at /accounts/oidc/keycloak/login/
Exception Value: 400 Client Error:  for url: https://auth.REDACTED.REDACTED.com/realms/REDACTED/.well-known/openid-configuration
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

1 participant