nextcloud / nextcloud/user_oidc

Getting 502 sometimes on login and always on logout

Open
#734 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug priority: normal
Dominant language
PHP
Stars
181
Forks
60
Avg merge
7h 34m
Merged PRs (30d)
26

Description

After changing the IdP domain I am getting a 502 after the redirection from Authentik with the link https://domain.tld/apps/user_oidc/sls?requesttoken=rjOEcLJdZwWVZWO36qJmrJn/xxxxxxxqt4avU%3D:y3LRQuocSGT3TlLbptgjxdvItdy0xxxBJLI%3D
but only sometimes on login, but i seem to be logged in because when I visit NC with the base url after that I am logged in.
But logging out always produces the 502 aswell.
The logs only show this
Fehler | user_oidc | Impossible to decode OIDC token:Error: kid must be provided in JWT header.
and
OC\Authentication\Exceptions\InvalidTokenException: Token does not exist: token does not exist

I am running NC with Authentik on another install and it is working flawlessly there. Any hints on getting it debugged further?
The console logs of Authentik and NC dont show anything interesting regarding this issue.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The reported entry points are the user_oidc login redirect and logout flow; reproduce both after changing the IdP domain while collecting the user_oidc and Nextcloud logs. Use the “kid must be provided in JWT header” and “Token does not exist” errors to trace the failure, with completion shown by login and logout no longer returning 502.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
authentication, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.