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

ERROR Internal Server Error: /oidc/callback/ #803

Open
hllshiro opened this issue Aug 29, 2024 · 1 comment
Open

ERROR Internal Server Error: /oidc/callback/ #803

hllshiro opened this issue Aug 29, 2024 · 1 comment
Labels
help wanted Extra attention is needed

Comments

@hllshiro
Copy link

I use a authentik auth2 provider, but get an error when excute callback. Is there someone can give me some help?

linkding  | [pid: 30|app: 0|req: 7/13] 172.19.0.1 () {52 vars in 1065 bytes} [Thu Aug 29 15:17:06 2024] GET /oidc/authenticate/ => generated 0 bytes in 55 msecs (HTTP/1.1 302) 10 headers in 806 bytes (1 switches on core 0)
linkding  | 2024-08-29 15:17:07,706 ERROR Internal Server Error: /oidc/callback/
linkding  | Traceback (most recent call last):
linkding  |   File "/opt/venv/lib/python3.11/site-packages/django/core/handlers/exception.py", line 55, in inner
linkding  |     response = get_response(request)
linkding  |                ^^^^^^^^^^^^^^^^^^^^^
linkding  |   File "/opt/venv/lib/python3.11/site-packages/django/core/handlers/base.py", line 197, in _get_response
linkding  |     response = wrapped_callback(request, *callback_args, **callback_kwargs)
linkding  |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
linkding  |   File "/opt/venv/lib/python3.11/site-packages/django/views/generic/base.py", line 104, in view
linkding  |     return self.dispatch(request, *args, **kwargs)
linkding  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
linkding  |   File "/opt/venv/lib/python3.11/site-packages/django/views/generic/base.py", line 143, in dispatch
linkding  |     return handler(request, *args, **kwargs)
linkding  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
linkding  |   File "/opt/venv/lib/python3.11/site-packages/mozilla_django_oidc/views.py", line 124, in get
linkding  |     self.user = auth.authenticate(**kwargs)
linkding  |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
linkding  |   File "/opt/venv/lib/python3.11/site-packages/django/views/decorators/debug.py", line 75, in sensitive_variables_wrapper
linkding  |     return func(*func_args, **func_kwargs)
linkding  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
linkding  |   File "/opt/venv/lib/python3.11/site-packages/django/contrib/auth/__init__.py", line 79, in authenticate
linkding  |     user = backend.authenticate(request, **credentials)
linkding  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
linkding  |   File "/opt/venv/lib/python3.11/site-packages/mozilla_django_oidc/auth.py", line 321, in authenticate
linkding  |     payload = self.verify_token(id_token, nonce=nonce)
linkding  |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
linkding  |   File "/opt/venv/lib/python3.11/site-packages/mozilla_django_oidc/auth.py", line 211, in verify_token
linkding  |     key = self.retrieve_matching_jwk(token)
linkding  |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
linkding  |   File "/opt/venv/lib/python3.11/site-packages/mozilla_django_oidc/auth.py", line 175, in retrieve_matching_jwk
linkding  |     for jwk in jwks["keys"]:
linkding  |                ~~~~^^^^^^^^
linkding  | KeyError: 'keys'
linkding  | [pid: 30|app: 0|req: 8/14] 172.19.0.1 () {48 vars in 1171 bytes} [Thu Aug 29 15:17:07 2024] GET /oidc/callback/?code=c5b8745e6bb14ef9af4067c2559993fe&state=I3mjwSctE7Tr55MJOZr9RVq8JRG6NeYk => generated 145 bytes in 456 msecs (HTTP/1.1 500) 8 headers in 276 bytes (1 switches on core 1)

here is my .env

# OIDC
LD_ENABLE_OIDC=True
OIDC_OP_AUTHORIZATION_ENDPOINT=https://xxx:9443/application/o/authorize/
OIDC_OP_TOKEN_ENDPOINT=https://xxx:9443/application/o/token/
OIDC_OP_USER_ENDPOINT=https://xxx:9443/application/o/userinfo/
OIDC_OP_JWKS_ENDPOINT=https://xxx:9443/application/o/linkding/jwks/
OIDC_RP_CLIENT_ID=xxx
OIDC_RP_CLIENT_SECRET=xxx
@github-staff github-staff deleted a comment from hllshiro Aug 29, 2024
@cirrusflyer
Copy link

I'm seeing same errors with latest version when trying to take an HTML snapshot. And I'm not using any auth provider.

@sissbruecker sissbruecker added the help wanted Extra attention is needed label Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants
@sissbruecker @cirrusflyer @hllshiro and others