Skip to content

fix: set IUserSession user after bearer token validation - #1376

Merged
julien-nc merged 2 commits into
nextcloud:mainfrom
hangerrits:fix/bearer-token-set-user-session
Mar 18, 2026
Merged

fix: set IUserSession user after bearer token validation#1376
julien-nc merged 2 commits into
nextcloud:mainfrom
hangerrits:fix/bearer-token-set-user-session

Conversation

@hangerrits

Copy link
Copy Markdown
Contributor

Summary

When user_oidc validates a bearer token in Backend::getCurrentUserId(), it returns the correct userId but does not call IUserSession::setUser().
This leaves the user session in an inconsistent state where getCurrentUserId() succeeds but DI-injected $userId parameters remain null.

Problem

OCS controllers and CalDAV plugins that receive $userId via dependency injection get null instead of the authenticated user's ID when the request
is authenticated via OIDC bearer token. This causes:

  • Deck: TypeError: ...$userId must be of type string, null given
  • Talk: Same TypeError pattern
  • Tasks (CalDAV): 500 errors from null userId

These apps work correctly with session-based OIDC login (where setUser() IS called) but fail with bearer token authentication.

Fix

Call IUserSession::setUser() after successful bearer token validation at all three return points in getCurrentUserId(). IUserSession is resolved via
Server::get() rather than constructor injection to avoid a circular dependency.

Testing

  1. Configure an OIDC provider with bearer token validation enabled
  2. Make API requests to Deck, Talk, or CalDAV endpoints using a bearer token
  3. Verify 200 responses instead of 500 errors

@hangerrits
hangerrits force-pushed the fix/bearer-token-set-user-session branch from 6e362a4 to 14378e9 Compare March 13, 2026 16:14
Comment thread lib/User/Backend.php

@julien-nc julien-nc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks.
If you can rebase on main and fix the cs issue (run composer run cs:fix), let's merge that soon.

hangerrits and others added 2 commits March 16, 2026 20:16
Signed-off-by: Han Gerrits <han@gerrits.net>

fix: set IUserSession user after bearer token validation" --body "## Summary

  When user_oidc validates a bearer token in Backend::getCurrentUserId(), it returns the correct userId but does not call IUserSession::setUser().
  This leaves the user session in an inconsistent state where getCurrentUserId() succeeds but DI-injected \$userId parameters remain null.

  ## Problem

  OCS controllers and CalDAV plugins that receive \$userId via dependency injection get null instead of the authenticated user's ID when the request
  is authenticated via OIDC bearer token. This causes:

  - **Deck**: TypeError: ...\$userId must be of type string, null given
  - **Talk**: Same TypeError pattern
  - **Tasks** (CalDAV): 500 errors from null userId

  These apps work correctly with session-based OIDC login (where setUser() IS called) but fail with bearer token authentication.

  ## Fix

  Call IUserSession::setUser() after successful bearer token validation at all three return points in getCurrentUserId(). IUserSession is resolved via
   Server::get() rather than constructor injection to avoid a circular dependency.

  ## Testing

  1. Configure an OIDC provider with bearer token validation enabled
  2. Make API requests to Deck, Talk, or CalDAV endpoints using a bearer token
  3. Verify 200 responses instead of 500 errors"
agree, that's better

Co-authored-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
Signed-off-by: Han Gerrits <han@newtech.studio>
@hangerrits
hangerrits force-pushed the fix/bearer-token-set-user-session branch from 14a2c8e to 7f8893e Compare March 16, 2026 19:17
@hangerrits
hangerrits requested a review from julien-nc March 16, 2026 19:18
@julien-nc
julien-nc merged commit 3933a24 into nextcloud:main Mar 18, 2026
48 of 53 checks passed
@julien-nc julien-nc mentioned this pull request Mar 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

@artonge

artonge commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

@hangerrits & @solracsf, looks like this PR is causing the following issue: #1452

@pringelmann tried to reproduce your original issue, but couldn't.

I haven't looked too much into it, but could it be that your original issue has been fixed somewhere else, making this PR safely revertable?

@solracsf

Copy link
Copy Markdown
Member

@artonge I've approved #1486

@artonge

artonge commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

@artonge I've approved #1486

Alright, @pringelmann will take a look at it next week. Maybe @printminion-co can also try out the PR in the meantime and see if it fixes their issue?

pringelmann pushed a commit that referenced this pull request Aug 21, 2026
Reverts the setSessionUser() calls added in #1376.

IApacheBackend::getCurrentUserId() is called from the first line of
loginWithApache(), which guards its whole login block on the active
user not already being set. Setting the session user inside
getCurrentUserId() satisfies that guard before core reaches it, so the
entire block gets skipped: no oc_authtoken row, no remember-me cookie,
no filesystem setup, no login events.

The missing token row breaks any later request that reuses the
session cookie. Session::validateSession() looks up a token by session
id, finds none, and calls logout(), which strips the cookie and
returns a 401.

Confirmed independently against master and 8.11.0-dev: bearer request
then cookie-only request goes 200 then 401 with the calls in place,
200 then 200 with them removed. DAV also reaches this code through
apps/dav's own handleApacheAuth() call site, confirmed 207 both before
and after.

Signed-off-by: mostafa <mostafakhaki00@gmail.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
o-m-n-i added a commit to Junovy-Hosting/junovy_user_oidc that referenced this pull request Sep 3, 2026
…35 occ fix, provisioning toggle) (#7)

* fix(gss): Improve error logging for JWT decode failures in SLS

Changed log level from debug to error for GSS JWT decode failures
in singleLogoutService. Added specific DomainException handling
with actionable message about minimum key length requirement
(32 chars for HS256 per RFC 7518).

Signed-off-by: nfebe <fenn25.fn@gmail.com>

* fix: handle dot-containing claim names in nested claim resolution

Replace explode('.') with greedy longest-prefix matching that tries the
full remaining path as a literal key first, then progressively shorter
dot-prefixed segments. This correctly handles URL-based claim names
(e.g. "https://idp.example.com/claims/groups") and object keys with
literal dots (e.g. "user.role") as permitted by OIDC Core §5.1.2.

Backward compatible: existing dot-separated nested paths resolve
identically since the algorithm falls through to the same splits.

Fixes nextcloud#1373
Related: nextcloud#1100

Signed-off-by: Strobel Pierre <strobelpierre@gmail.com>

* fix: Use newer API when available

OC_Util is on the way out

Signed-off-by: Carl Schwan <carlschwan@kde.org>

* refactor(backend): Use non-deprecated methods when possible

Signed-off-by: Carl Schwan <carlschwan@kde.org>

* fix(psalm): ignore undefined classes until our min supported NC version includes them, trust the unit/integration tests to spot issues with the new methods/classes

Signed-off-by: Julien Veyssier <julien-nc@posteo.net>

* fix: set IUserSession user after bearer token validation

Signed-off-by: Han Gerrits <han@gerrits.net>

fix: set IUserSession user after bearer token validation" --body "## Summary

  When user_oidc validates a bearer token in Backend::getCurrentUserId(), it returns the correct userId but does not call IUserSession::setUser().
  This leaves the user session in an inconsistent state where getCurrentUserId() succeeds but DI-injected \$userId parameters remain null.

  ## Problem

  OCS controllers and CalDAV plugins that receive \$userId via dependency injection get null instead of the authenticated user's ID when the request
  is authenticated via OIDC bearer token. This causes:

  - **Deck**: TypeError: ...\$userId must be of type string, null given
  - **Talk**: Same TypeError pattern
  - **Tasks** (CalDAV): 500 errors from null userId

  These apps work correctly with session-based OIDC login (where setUser() IS called) but fail with bearer token authentication.

  ## Fix

  Call IUserSession::setUser() after successful bearer token validation at all three return points in getCurrentUserId(). IUserSession is resolved via
   Server::get() rather than constructor injection to avoid a circular dependency.

  ## Testing

  1. Configure an OIDC provider with bearer token validation enabled
  2. Make API requests to Deck, Talk, or CalDAV endpoints using a bearer token
  3. Verify 200 responses instead of 500 errors"

* Apply suggestion from @solracsf

agree, that's better

Co-authored-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
Signed-off-by: Han Gerrits <han@newtech.studio>

* do not log sensitive data

Signed-off-by: Julien Veyssier <julien-nc@posteo.net>

* show test deprecations

Signed-off-by: Julien Veyssier <julien-nc@posteo.net>

* replace deprecated dataProvider annotations with method attributes in tests

Signed-off-by: Julien Veyssier <julien-nc@posteo.net>

* replace returnValueMap by willReturnMap

Signed-off-by: Julien Veyssier <julien-nc@posteo.net>

* find a replacement for the deprecated addMethods in tests

Signed-off-by: Julien Veyssier <julien-nc@posteo.net>

* update composer dependencies

Signed-off-by: Julien Veyssier <julien-nc@posteo.net>

* Chore(deps-dev): Bump flatted from 3.3.3 to 3.4.2

Bumps [flatted](https://github.com/WebReflection/flatted) from 3.3.3 to 3.4.2.
- [Commits](WebReflection/flatted@v3.3.3...v3.4.2)

---
updated-dependencies:
- dependency-name: flatted
  dependency-version: 3.4.2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix(l10n): Update translations from Transifex

Signed-off-by: Nextcloud bot <bot@nextcloud.com>

* Switch to allow usage of Microsoft graph to lookup group names on Entra ID

Signed-off-by: Johan Bernhardsson <johan.bernhardsson@redpill-linpro.com>

* Small fixes to get patch to latest branch

Signed-off-by: Johan Bernhardsson <johan.bernhardsson@redpill-linpro.com>

* Added occ command and updated Readme

Signed-off-by: Johan Bernhardsson <johan.bernhardsson@redpill-linpro.com>

* Remove web ui setting and rename occ command to --entraid-group-names, update readme

Signed-off-by: Johan Bernhardsson <johan.bernhardsson@redpill-linpro.com>

* isolate azure-specific group logic in 2 methods

Signed-off-by: Julien Veyssier <julien-nc@posteo.net>

* fix: tests

Signed-off-by: Julien Veyssier <julien-nc@posteo.net>

* Chore(deps): Bump picomatch

Bumps  and [picomatch](https://github.com/micromatch/picomatch). These dependencies needed to be updated together.

Updates `picomatch` from 2.3.1 to 2.3.2
- [Release notes](https://github.com/micromatch/picomatch/releases)
- [Changelog](https://github.com/micromatch/picomatch/blob/master/CHANGELOG.md)
- [Commits](micromatch/picomatch@2.3.1...2.3.2)

Updates `picomatch` from 4.0.3 to 4.0.4
- [Release notes](https://github.com/micromatch/picomatch/releases)
- [Changelog](https://github.com/micromatch/picomatch/blob/master/CHANGELOG.md)
- [Commits](micromatch/picomatch@2.3.1...2.3.2)

---
updated-dependencies:
- dependency-name: picomatch
  dependency-version: 2.3.2
  dependency-type: indirect
- dependency-name: picomatch
  dependency-version: 4.0.4
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix(l10n): Update translations from Transifex

Signed-off-by: Nextcloud bot <bot@nextcloud.com>

* feat(occ): always hide the provider secrets with 'occ providers'

Signed-off-by: Julien Veyssier <julien-nc@posteo.net>

* in the user backend: only try to validate the auth if the Authorization header's value starts with 'Bearer'

Signed-off-by: Julien Veyssier <julien-nc@posteo.net>

* prepare 8.7.0

Signed-off-by: Julien Veyssier <julien-nc@posteo.net>

* feat: Refresh token during active user sessions

Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>

* Chore(deps): Bump firebase/php-jwt from 7.0.3 to 7.0.4

Bumps [firebase/php-jwt](https://github.com/firebase/php-jwt) from 7.0.3 to 7.0.4.
- [Release notes](https://github.com/firebase/php-jwt/releases)
- [Changelog](https://github.com/firebase/php-jwt/blob/main/CHANGELOG.md)
- [Commits](googleapis/php-jwt@v7.0.3...v7.0.4)

---
updated-dependencies:
- dependency-name: firebase/php-jwt
  dependency-version: 7.0.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Chore(deps): Bump serialize-javascript and terser-webpack-plugin

Removes [serialize-javascript](https://github.com/yahoo/serialize-javascript). It's no longer used after updating ancestor dependency [terser-webpack-plugin](https://github.com/webpack/terser-webpack-plugin). These dependencies need to be updated together.


Removes `serialize-javascript`

Updates `terser-webpack-plugin` from 5.3.16 to 5.4.0
- [Release notes](https://github.com/webpack/terser-webpack-plugin/releases)
- [Changelog](https://github.com/webpack/terser-webpack-plugin/blob/main/CHANGELOG.md)
- [Commits](webpack/minimizer-webpack-plugin@v5.3.16...v5.4.0)

---
updated-dependencies:
- dependency-name: serialize-javascript
  dependency-version: 
  dependency-type: indirect
- dependency-name: terser-webpack-plugin
  dependency-version: 5.4.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Chore(deps-dev): Bump node-forge from 1.3.3 to 1.4.0

Bumps [node-forge](https://github.com/digitalbazaar/forge) from 1.3.3 to 1.4.0.
- [Changelog](https://github.com/digitalbazaar/forge/blob/main/CHANGELOG.md)
- [Commits](digitalbazaar/forge@v1.3.3...v1.4.0)

---
updated-dependencies:
- dependency-name: node-forge
  dependency-version: 1.4.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Chore(deps-dev): Bump brace-expansion from 1.1.12 to 1.1.13

Bumps [brace-expansion](https://github.com/juliangruber/brace-expansion) from 1.1.12 to 1.1.13.
- [Release notes](https://github.com/juliangruber/brace-expansion/releases)
- [Commits](juliangruber/brace-expansion@v1.1.12...v1.1.13)

---
updated-dependencies:
- dependency-name: brace-expansion
  dependency-version: 1.1.13
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* refactor: move to ITimeFactory

Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>

* Chore(deps-dev): Bump symfony/event-dispatcher from 7.4.4 to 7.4.8

Bumps [symfony/event-dispatcher](https://github.com/symfony/event-dispatcher) from 7.4.4 to 7.4.8.
- [Release notes](https://github.com/symfony/event-dispatcher/releases)
- [Changelog](https://github.com/symfony/event-dispatcher/blob/8.1/CHANGELOG.md)
- [Commits](symfony/event-dispatcher@v7.4.4...v7.4.8)

---
updated-dependencies:
- dependency-name: symfony/event-dispatcher
  dependency-version: 7.4.8
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Chore(deps): Bump firebase/php-jwt from 7.0.4 to 7.0.5

Bumps [firebase/php-jwt](https://github.com/firebase/php-jwt) from 7.0.4 to 7.0.5.
- [Release notes](https://github.com/firebase/php-jwt/releases)
- [Changelog](https://github.com/firebase/php-jwt/blob/main/CHANGELOG.md)
- [Commits](googleapis/php-jwt@v7.0.4...v7.0.5)

---
updated-dependencies:
- dependency-name: firebase/php-jwt
  dependency-version: 7.0.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* refactor(commands): Add return types

Signed-off-by: Carl Schwan <carlschwan@kde.org>

* fix: Trigger UserFirstTimeLoggedInEvent

We now depends on NC > 29

Signed-off-by: Carl Schwan <carlschwan@kde.org>

* Chore(deps-dev): Bump lodash from 4.17.23 to 4.18.1

Bumps [lodash](https://github.com/lodash/lodash) from 4.17.23 to 4.18.1.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](lodash/lodash@4.17.23...4.18.1)

---
updated-dependencies:
- dependency-name: lodash
  dependency-version: 4.18.1
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* remove ApiController and keep OcsApiController

Signed-off-by: Julien Veyssier <julien-nc@posteo.net>

* prepare 8.8.0

Signed-off-by: Julien Veyssier <julien-nc@posteo.net>

* Chore(deps): Bump vite from 7.3.0 to 7.3.2

Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 7.3.0 to 7.3.2.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v7.3.2/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v7.3.2/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-version: 7.3.2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix: Remove ServerVersion usage

ServerVersion isn't defined on NC < 31 so use the old fascioned
OC_Version instead :/

Signed-off-by: Carl Schwan <carlschwan@kde.org>

* Chore(deps): Bump fast-xml-parser from 4.5.4 to 4.5.6

Bumps [fast-xml-parser](https://github.com/NaturalIntelligence/fast-xml-parser) from 4.5.4 to 4.5.6.
- [Release notes](https://github.com/NaturalIntelligence/fast-xml-parser/releases)
- [Changelog](https://github.com/NaturalIntelligence/fast-xml-parser/blob/master/CHANGELOG.md)
- [Commits](NaturalIntelligence/fast-xml-parser@v4.5.4...v4.5.6)

---
updated-dependencies:
- dependency-name: fast-xml-parser
  dependency-version: 4.5.6
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Chore(deps): Bump phpseclib/phpseclib from 2.0.52 to 2.0.53

Bumps [phpseclib/phpseclib](https://github.com/phpseclib/phpseclib) from 2.0.52 to 2.0.53.
- [Release notes](https://github.com/phpseclib/phpseclib/releases)
- [Changelog](https://github.com/phpseclib/phpseclib/blob/master/CHANGELOG.md)
- [Commits](phpseclib/phpseclib@2.0.52...2.0.53)

---
updated-dependencies:
- dependency-name: phpseclib/phpseclib
  dependency-version: 2.0.53
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* feat: Use new IAlternativeLoginProvider when available

Signed-off-by: Carl Schwan <carlschwan@kde.org>

* fix(psalm): ignore missing IAlternativeLoginProvider (@SInCE 34) and rename getAlternativeLogin to getAlternativeLogins

Signed-off-by: Julien Veyssier <julien-nc@posteo.net>

* fix(tests): the alternative login can have a 'class' attr if IAlternativeLogin is used

Signed-off-by: Julien Veyssier <julien-nc@posteo.net>

* perf(ldap): Optimize check if LDAP user is deleted

Check first if the current user is deleted, before loading all the
deleted users and checking if their deletion is still up-to-date.

Allow to abort early for non-deleted users.

Signed-off-by: Carl Schwan <carlschwan@kde.org>

* Chore(deps): Bump follow-redirects from 1.15.11 to 1.16.0

Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.11 to 1.16.0.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](follow-redirects/follow-redirects@v1.15.11...v1.16.0)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-version: 1.16.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Chore(deps): Bump dompurify from 3.3.2 to 3.4.0

Bumps [dompurify](https://github.com/cure53/DOMPurify) from 3.3.2 to 3.4.0.
- [Release notes](https://github.com/cure53/DOMPurify/releases)
- [Commits](cure53/DOMPurify@3.3.2...3.4.0)

---
updated-dependencies:
- dependency-name: dompurify
  dependency-version: 3.4.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* prepare 8.9.0

Signed-off-by: Julien Veyssier <julien-nc@posteo.net>

* feat(code-flow): add debug log when storing the state in the php session

Signed-off-by: Julien Veyssier <julien-nc@posteo.net>

* fix: only redirect to the login flow when the request comes from a 'navigation' context

Signed-off-by: Julien Veyssier <julien-nc@posteo.net>

* make isTopLevelHtmlNavigation less restrictive

Signed-off-by: Julien Veyssier <julien-nc@posteo.net>

* allow storing multiple states, cleanup on failure is still missing

Signed-off-by: Julien Veyssier <julien-nc@posteo.net>

* delete flow session values when the code endpoint fails or succeeds

Signed-off-by: Julien Veyssier <julien-nc@posteo.net>

* check if user is logged in at the beginning of the code endpoint. if so, redirect to the redirect URL and do nothing

Signed-off-by: Julien Veyssier <julien-nc@posteo.net>

* adjust isTopLevelHtmlNavigation tests

Signed-off-by: Julien Veyssier <julien-nc@posteo.net>

* perf: Optimize counting of users

Do it on the database level instead of the PHP level.

Co-Authored-By: Git'Fellow <12234510+solracsf@users.noreply.github.com>
Signed-off-by: Carl Schwan <carlschwan@kde.org>

* refactor: Modernize a bit user backend

Co-Authored-By: Git'Fellow <12234510+solracsf@users.noreply.github.com>
Signed-off-by: Carl Schwan <carlschwan@kde.org>

* refactor: Harden UserBackend::provisionUser and UserBackend::checkFirstLogin

Add more debug logs when something go wrong and more checks for invalid
values.

Co-Authored-By: Git'Fellow <12234510+solracsf@users.noreply.github.com>
Signed-off-by: Carl Schwan <carlschwan@kde.org>

* prepare 8.10.0

Signed-off-by: Julien Veyssier <julien-nc@posteo.net>

* fix(l10n): Update translations from Transifex

Signed-off-by: Nextcloud bot <bot@nextcloud.com>

* fix(l10n): Update translations from Transifex

Signed-off-by: Nextcloud bot <bot@nextcloud.com>

* fix(l10n): Update translations from Transifex

Signed-off-by: Nextcloud bot <bot@nextcloud.com>

* fix(l10n): Update translations from Transifex

Signed-off-by: Nextcloud bot <bot@nextcloud.com>

* fix(l10n): Update translations from Transifex

Signed-off-by: Nextcloud bot <bot@nextcloud.com>

* fix(l10n): Update translations from Transifex

Signed-off-by: Nextcloud bot <bot@nextcloud.com>

* fix(versionCheck): use version_compare and IConfig::getSystemValueString('version', '0.0.0') to check the server version

Signed-off-by: Julien Veyssier <julien-nc@posteo.net>

* prepare 8.10.1

Signed-off-by: Julien Veyssier <julien-nc@posteo.net>

* chore(CI): Updating pr-feedback.yml workflow from template

Signed-off-by: Nextcloud bot <bot@nextcloud.com>

* fix(login): treat already-logged-out as success in backchannel logout

Closes nextcloud#1430.

OIDC Backchannel Logout 1.0 §2.6 says:

  'If the identified End-User is already logged out at the RP when
   the logout request is received, the logout is considered to have
   succeeded.'

Today `backChannelLogout()` returns HTTP/400 when the (sid, iss)
or (sub, iss) lookup yields no matching session, even though that
is exactly the already-logged-out case the spec calls out as a
*success*. IdPs (e.g. LemonLDAP, Keycloak) surface this 400 to the
end user and log a spurious error.

The other validation branches in this method — invalid issuer,
invalid signature, missing claims, malformed token — keep their
HTTP/400 responses. Only the two 'session not found' paths flip
to HTTP/200 + a debug log so administrators can still trace what
happened.

See https://openid.net/specs/openid-connect-backchannel-1_0.html#BCActions

Signed-off-by: SAY-5 <say.apm35@gmail.com>

* enh(avatar): add a fallback case when parsing the avatar attr: decode it as base64

Signed-off-by: Julien Veyssier <julien-nc@posteo.net>

* fix(BackchannelLogout): apply review feedback (nextcloud#1431)

Address julien-nc's review:

  - Shorten the long rationale comment to a one-liner with the spec
    link, per inline review at lib/Controller/LoginController.php:940.
  - Drop the redundant ' per spec' suffix from both already-logged-out
    debug log lines (lib/Controller/LoginController.php:942 and :972),
    matching the suggested edits.

Behaviour is unchanged — only comment / log message wording.

Signed-off-by: SAY-5 <say.apm35@gmail.com>

* Chore(deps-dev): Bump symfony/event-dispatcher from 7.4.8 to 7.4.9

Bumps [symfony/event-dispatcher](https://github.com/symfony/event-dispatcher) from 7.4.8 to 7.4.9.
- [Release notes](https://github.com/symfony/event-dispatcher/releases)
- [Changelog](https://github.com/symfony/event-dispatcher/blob/8.1/CHANGELOG.md)
- [Commits](symfony/event-dispatcher@v7.4.8...v7.4.9)

---
updated-dependencies:
- dependency-name: symfony/event-dispatcher
  dependency-version: 7.4.9
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Chore(deps): Bump postcss from 8.5.6 to 8.5.13

Bumps [postcss](https://github.com/postcss/postcss) from 8.5.6 to 8.5.13.
- [Release notes](https://github.com/postcss/postcss/releases)
- [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md)
- [Commits](postcss/postcss@8.5.6...8.5.13)

---
updated-dependencies:
- dependency-name: postcss
  dependency-version: 8.5.13
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Improved logging for failed BC logout

refurbished $throttleMetadata not used since 9b5d6c6

Signed-off-by: Spitap <dev@asdrip.fr>

* Fixed DB exception

Signed-off-by: Spitap <dev@asdrip.fr>

* tell idp not to cache BC logout response

Signed-off-by: Spitap <dev@asdrip.fr>

* Check for the required claims

Signed-off-by: Spitap <dev@asdrip.fr>

* added verification for exp and iss in BC-LO

Signed-off-by: Spitap <dev@asdrip.fr>

* Removed exp claim from required BC-LO

deliberately removed. See nextcloud#1432

Signed-off-by: Spitap <dev@asdrip.fr>

* Chore(deps): Bump phpseclib/phpseclib from 2.0.53 to 2.0.54

Bumps [phpseclib/phpseclib](https://github.com/phpseclib/phpseclib) from 2.0.53 to 2.0.54.
- [Release notes](https://github.com/phpseclib/phpseclib/releases)
- [Changelog](https://github.com/phpseclib/phpseclib/blob/master/CHANGELOG.md)
- [Commits](phpseclib/phpseclib@2.0.53...2.0.54)

---
updated-dependencies:
- dependency-name: phpseclib/phpseclib
  dependency-version: 2.0.54
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix(l10n): Update translations from Transifex

Signed-off-by: Nextcloud bot <bot@nextcloud.com>

* fix(l10n): Update translations from Transifex

Signed-off-by: Nextcloud bot <bot@nextcloud.com>

* Chore(deps-dev): Bump fast-uri from 3.1.0 to 3.1.2

Bumps [fast-uri](https://github.com/fastify/fast-uri) from 3.1.0 to 3.1.2.
- [Release notes](https://github.com/fastify/fast-uri/releases)
- [Commits](fastify/fast-uri@v3.1.0...v3.1.2)

---
updated-dependencies:
- dependency-name: fast-uri
  dependency-version: 3.1.2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix(l10n): Update translations from Transifex

Signed-off-by: Nextcloud bot <bot@nextcloud.com>

* fix(l10n): Update translations from Transifex

Signed-off-by: Nextcloud bot <bot@nextcloud.com>

* chore(CI): Adjust testing matrix for Nextcloud 34 on main

Signed-off-by: Joas Schilling <coding@schilljs.com>

* feat(deps): Add Nextcloud 35 support

Signed-off-by: Joas Schilling <coding@schilljs.com>

* fix(l10n): Update translations from Transifex

Signed-off-by: Nextcloud bot <bot@nextcloud.com>

* Revert "Removed exp claim from required BC-LO"

This reverts commit 7fcb03d.

Signed-off-by: Spitap <dev@asdrip.fr>

* Make sure exp is not null BC-LO

Signed-off-by: Spitap <dev@asdrip.fr>

* fix(l10n): Update translations from Transifex

Signed-off-by: Nextcloud bot <bot@nextcloud.com>

* Fixed Disable Other Login Methods command

Fixed Disable Other Login Methods command.  Missed a /

Signed-off-by: JATippit <11259172+JATippit@users.noreply.github.com>

* Add per-provider enrich with userinfo endpoint setting

Signed-off-by: s3n-w6i <37022952+s3n-w6i@users.noreply.github.com>

* Revert adding translations

Signed-off-by: s3n-w6i <37022952+s3n-w6i@users.noreply.github.com>

* Fix integration tests in ProviderServiceTest.php

testGetProvidersWithSettings: Since all boolean options are set to true by default, also set enrichLoginIdTokenWithUserinfo to true

testSetSettings: Add missing enrichLoginIdTokenWithUserinfo field

Signed-off-by: s3n-w6i <37022952+s3n-w6i@users.noreply.github.com>

* fix(l10n): Update translations from Transifex

Signed-off-by: Nextcloud bot <bot@nextcloud.com>

* Chore(deps-dev): Bump nextcloud/coding-standard from 1.4.0 to 1.5.0

Bumps [nextcloud/coding-standard](https://github.com/nextcloud/coding-standard) from 1.4.0 to 1.5.0.
- [Release notes](https://github.com/nextcloud/coding-standard/releases)
- [Changelog](https://github.com/nextcloud/coding-standard/blob/master/CHANGELOG.md)
- [Commits](nextcloud/coding-standard@v1.4.0...v1.5.0)

---
updated-dependencies:
- dependency-name: nextcloud/coding-standard
  dependency-version: 1.5.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix(l10n): Update translations from Transifex

Signed-off-by: Nextcloud bot <bot@nextcloud.com>

* refactor: Run new version of nextcloud/coding-standard

Signed-off-by: Carl Schwan <carlschwan@kde.org>

* fix(l10n): Update translations from Transifex

Signed-off-by: Nextcloud bot <bot@nextcloud.com>

* fix(l10n): Update translations from Transifex

Signed-off-by: Nextcloud bot <bot@nextcloud.com>

* fix(l10n): Update translations from Transifex

Signed-off-by: Nextcloud bot <bot@nextcloud.com>

* Chore(deps-dev): Bump shell-quote from 1.8.3 to 1.8.4

Bumps [shell-quote](https://github.com/ljharb/shell-quote) from 1.8.3 to 1.8.4.
- [Changelog](https://github.com/ljharb/shell-quote/blob/main/CHANGELOG.md)
- [Commits](ljharb/shell-quote@v1.8.3...v1.8.4)

---
updated-dependencies:
- dependency-name: shell-quote
  dependency-version: 1.8.4
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix(l10n): Update translations from Transifex

Signed-off-by: Nextcloud bot <bot@nextcloud.com>

* fix(l10n): Update translations from Transifex

Signed-off-by: Nextcloud bot <bot@nextcloud.com>

* fix(l10n): Update translations from Transifex

Signed-off-by: Nextcloud bot <bot@nextcloud.com>

* Chore(deps): Bump dompurify from 3.4.0 to 3.4.11

Bumps [dompurify](https://github.com/cure53/DOMPurify) from 3.4.0 to 3.4.11.
- [Release notes](https://github.com/cure53/DOMPurify/releases)
- [Commits](cure53/DOMPurify@3.4.0...3.4.11)

---
updated-dependencies:
- dependency-name: dompurify
  dependency-version: 3.4.11
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix(l10n): Update translations from Transifex

Signed-off-by: Nextcloud bot <bot@nextcloud.com>

* Chore(deps-dev): Bump launch-editor from 2.12.0 to 2.14.1

Bumps [launch-editor](https://github.com/vitejs/launch-editor) from 2.12.0 to 2.14.1.
- [Commits](vitejs/launch-editor@v2.12.0...v2.14.1)

---
updated-dependencies:
- dependency-name: launch-editor
  dependency-version: 2.14.1
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Chore(deps): Bump firebase/php-jwt from 7.0.5 to 7.1.0

Bumps [firebase/php-jwt](https://github.com/firebase/php-jwt) from 7.0.5 to 7.1.0.
- [Release notes](https://github.com/firebase/php-jwt/releases)
- [Changelog](https://github.com/googleapis/php-jwt/blob/main/CHANGELOG.md)
- [Commits](googleapis/php-jwt@v7.0.5...v7.1.0)

---
updated-dependencies:
- dependency-name: firebase/php-jwt
  dependency-version: 7.1.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix(l10n): Update translations from Transifex

Signed-off-by: Nextcloud bot <bot@nextcloud.com>

* fix(l10n): Update translations from Transifex

Signed-off-by: Nextcloud bot <bot@nextcloud.com>

* fix(l10n): Update translations from Transifex

Signed-off-by: Nextcloud bot <bot@nextcloud.com>

* fix(l10n): Update translations from Transifex

Signed-off-by: Nextcloud bot <bot@nextcloud.com>

* fix(l10n): Update translations from Transifex

Signed-off-by: Nextcloud bot <bot@nextcloud.com>

* fix(l10n): Update translations from Transifex

Signed-off-by: Nextcloud bot <bot@nextcloud.com>

* fix(l10n): Update translations from Transifex

Signed-off-by: Nextcloud bot <bot@nextcloud.com>

* fix(l10n): Update translations from Transifex

Signed-off-by: Nextcloud bot <bot@nextcloud.com>

* perf: Only fetch full group information when needed

Signed-off-by: Carl Schwan <carlschwan@kde.org>

* chore(ci): Fix compatibility matrix

Master is not compatible with php 8.2 anymore

Signed-off-by: Carl Schwan <carlschwan@kde.org>

* Chore(deps-dev): Bump ws from 8.18.3 to 8.21.0

Bumps [ws](https://github.com/websockets/ws) from 8.18.3 to 8.21.0.
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](websockets/ws@8.18.3...8.21.0)

---
updated-dependencies:
- dependency-name: ws
  dependency-version: 8.21.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Chore(deps-dev): Bump js-yaml from 4.1.1 to 4.3.0

Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 4.1.1 to 4.3.0.
- [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md)
- [Commits](nodeca/js-yaml@4.1.1...4.3.0)

---
updated-dependencies:
- dependency-name: js-yaml
  dependency-version: 4.3.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Chore(deps-dev): Bump symfony/event-dispatcher from 7.4.9 to 7.4.14

Bumps [symfony/event-dispatcher](https://github.com/symfony/event-dispatcher) from 7.4.9 to 7.4.14.
- [Release notes](https://github.com/symfony/event-dispatcher/releases)
- [Changelog](https://github.com/symfony/event-dispatcher/blob/8.2/CHANGELOG.md)
- [Commits](symfony/event-dispatcher@v7.4.9...v7.4.14)

---
updated-dependencies:
- dependency-name: symfony/event-dispatcher
  dependency-version: 7.4.14
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix(ci): formatting of yaml file

Signed-off-by: Carl Schwan <carlschwan@kde.org>

* Chore(deps): Bump phpseclib/phpseclib from 2.0.54 to 2.0.55

Bumps [phpseclib/phpseclib](https://github.com/phpseclib/phpseclib) from 2.0.54 to 2.0.55.
- [Release notes](https://github.com/phpseclib/phpseclib/releases)
- [Changelog](https://github.com/phpseclib/phpseclib/blob/master/CHANGELOG.md)
- [Commits](phpseclib/phpseclib@2.0.54...2.0.55)

---
updated-dependencies:
- dependency-name: phpseclib/phpseclib
  dependency-version: 2.0.55
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Chore(deps): Bump vite from 7.3.2 to 7.3.5

Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 7.3.2 to 7.3.5.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v7.3.5/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v7.3.5/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-version: 7.3.5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Chore(deps-dev): Bump websocket-driver from 0.7.4 to 0.7.5

Bumps [websocket-driver](https://github.com/faye/websocket-driver-node) from 0.7.4 to 0.7.5.
- [Changelog](https://github.com/faye/websocket-driver-node/blob/main/CHANGELOG.md)
- [Commits](faye/websocket-driver-node@0.7.4...0.7.5)

---
updated-dependencies:
- dependency-name: websocket-driver
  dependency-version: 0.7.5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Chore(deps-dev): Bump phpunit/phpunit from 11.5.55 to 11.5.56

Bumps [phpunit/phpunit](https://github.com/sebastianbergmann/phpunit) from 11.5.55 to 11.5.56.
- [Release notes](https://github.com/sebastianbergmann/phpunit/releases)
- [Changelog](https://github.com/sebastianbergmann/phpunit/blob/11.5.56/ChangeLog-11.5.md)
- [Commits](sebastianbergmann/phpunit@11.5.55...11.5.56)

---
updated-dependencies:
- dependency-name: phpunit/phpunit
  dependency-version: 11.5.56
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix(l10n): Update translations from Transifex

Signed-off-by: Nextcloud bot <bot@nextcloud.com>

* fix(l10n): Update translations from Transifex

Signed-off-by: Nextcloud bot <bot@nextcloud.com>

* feat: add release-relay.yml workflow

Signed-off-by: Carl Schwan <carl@carlschwan.eu>

* Chore(deps): Bump immutable from 5.1.5 to 5.1.9

Bumps [immutable](https://github.com/immutable-js/immutable-js) from 5.1.5 to 5.1.9.
- [Release notes](https://github.com/immutable-js/immutable-js/releases)
- [Changelog](https://github.com/immutable-js/immutable-js/blob/main/CHANGELOG.md)
- [Commits](immutable-js/immutable-js@v5.1.5...v5.1.9)

---
updated-dependencies:
- dependency-name: immutable
  dependency-version: 5.1.9
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Chore(deps): Bump dompurify from 3.4.11 to 3.4.12

Bumps [dompurify](https://github.com/cure53/DOMPurify) from 3.4.11 to 3.4.12.
- [Release notes](https://github.com/cure53/DOMPurify/releases)
- [Commits](cure53/DOMPurify@3.4.11...3.4.12)

---
updated-dependencies:
- dependency-name: dompurify
  dependency-version: 3.4.12
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Chore(deps-dev): Bump fast-uri from 3.1.2 to 3.1.4

Bumps [fast-uri](https://github.com/fastify/fast-uri) from 3.1.2 to 3.1.4.
- [Release notes](https://github.com/fastify/fast-uri/releases)
- [Commits](fastify/fast-uri@v3.1.2...v3.1.4)

---
updated-dependencies:
- dependency-name: fast-uri
  dependency-version: 3.1.4
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Chore(deps-dev): Bump shell-quote from 1.8.4 to 1.10.0

Bumps [shell-quote](https://github.com/ljharb/shell-quote) from 1.8.4 to 1.10.0.
- [Changelog](https://github.com/ljharb/shell-quote/blob/main/CHANGELOG.md)
- [Commits](ljharb/shell-quote@v1.8.4...v1.10.0)

---
updated-dependencies:
- dependency-name: shell-quote
  dependency-version: 1.10.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix(psalm): Make sure getLogoutUrl returns a non-empty-string

Signed-off-by: Carl Schwan <carl@carlschwan.eu>

* perf: Cache created user after creation

Signed-off-by: Carl Schwan <carl@carlschwan.eu>

* Chore(deps-dev): Bump symfony/event-dispatcher from 7.4.14 to 7.4.15

Bumps [symfony/event-dispatcher](https://github.com/symfony/event-dispatcher) from 7.4.14 to 7.4.15.
- [Release notes](https://github.com/symfony/event-dispatcher/releases)
- [Changelog](https://github.com/symfony/event-dispatcher/blob/8.2/CHANGELOG.md)
- [Commits](symfony/event-dispatcher@v7.4.14...v7.4.15)

---
updated-dependencies:
- dependency-name: symfony/event-dispatcher
  dependency-version: 7.4.15
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Chore(deps-dev): Bump fast-uri from 3.1.4 to 3.1.5

Bumps [fast-uri](https://github.com/fastify/fast-uri) from 3.1.4 to 3.1.5.
- [Release notes](https://github.com/fastify/fast-uri/releases)
- [Commits](fastify/fast-uri@v3.1.4...v3.1.5)

---
updated-dependencies:
- dependency-name: fast-uri
  dependency-version: 3.1.5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix: don't set session user in getCurrentUserId

Reverts the setSessionUser() calls added in nextcloud#1376.

IApacheBackend::getCurrentUserId() is called from the first line of
loginWithApache(), which guards its whole login block on the active
user not already being set. Setting the session user inside
getCurrentUserId() satisfies that guard before core reaches it, so the
entire block gets skipped: no oc_authtoken row, no remember-me cookie,
no filesystem setup, no login events.

The missing token row breaks any later request that reuses the
session cookie. Session::validateSession() looks up a token by session
id, finds none, and calls logout(), which strips the cookie and
returns a 401.

Confirmed independently against master and 8.11.0-dev: bearer request
then cookie-only request goes 200 then 401 with the calls in place,
200 then 200 with them removed. DAV also reaches this code through
apps/dav's own handleApacheAuth() call site, confirmed 207 both before
and after.

Signed-off-by: mostafa <mostafakhaki00@gmail.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* fix(l10n): Update translations from Transifex

Signed-off-by: Nextcloud bot <bot@nextcloud.com>

* Chore(deps): Bump dompurify from 3.4.12 to 3.4.13

Bumps [dompurify](https://github.com/cure53/DOMPurify) from 3.4.12 to 3.4.13.
- [Release notes](https://github.com/cure53/DOMPurify/releases)
- [Commits](cure53/DOMPurify@3.4.12...3.4.13)

---
updated-dependencies:
- dependency-name: dompurify
  dependency-version: 3.4.13
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* feat: Update standard workflows

Signed-off-by: Carl Schwan <carl@carlschwan.eu>

* Chore(deps-dev): Bump js-yaml from 4.3.0 to 4.3.1

Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 4.3.0 to 4.3.1.
- [Changelog](https://github.com/nodeca/js-yaml/blob/4.3.1/CHANGELOG.md)
- [Commits](nodeca/js-yaml@4.3.0...4.3.1)

---
updated-dependencies:
- dependency-name: js-yaml
  dependency-version: 4.3.1
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Chore(deps-dev): Bump brace-expansion from 1.1.13 to 1.1.18

Bumps [brace-expansion](https://github.com/juliangruber/brace-expansion) from 1.1.13 to 1.1.18.
- [Release notes](https://github.com/juliangruber/brace-expansion/releases)
- [Commits](juliangruber/brace-expansion@v1.1.13...v1.1.18)

---
updated-dependencies:
- dependency-name: brace-expansion
  dependency-version: 1.1.18
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Chore(deps): Bump nanoid from 3.3.11 to 3.3.18

Bumps [nanoid](https://github.com/ai/nanoid) from 3.3.11 to 3.3.18.
- [Release notes](https://github.com/ai/nanoid/releases)
- [Changelog](https://github.com/ai/nanoid/blob/3.3.18/CHANGELOG.md)
- [Commits](ai/nanoid@3.3.11...3.3.18)

---
updated-dependencies:
- dependency-name: nanoid
  dependency-version: 3.3.18
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Chore(deps): Bump postcss from 8.5.13 to 8.5.26

Bumps [postcss](https://github.com/postcss/postcss) from 8.5.13 to 8.5.26.
- [Release notes](https://github.com/postcss/postcss/releases)
- [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md)
- [Commits](postcss/postcss@8.5.13...8.5.26)

---
updated-dependencies:
- dependency-name: postcss
  dependency-version: 8.5.26
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* test: cover the bearer path not setting the session user

getCurrentUserId() runs as the first statement of OC_User::loginWithApache(),
which guards its whole login block on the session user not being set yet.
IUserSession::setUser() persists 'user_id', the key OC_User::getUser() reads,
so setting the session user from inside getCurrentUserId() closed that guard
and left the request without an oc_authtoken row.

Cover the three bearer return paths: each must resolve the user id without
IUserSession::setUser() being called and without 'user_id' reaching the
session. setVolatileActiveUser() is deliberately not covered, it does not
persist 'user_id' and so does not close the guard.

Fails on the three call sites removed here, passes without them.

Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>

* fix(userdata): returns list of groups

Signed-off-by: Maxence Lange <maxence@artificial-owl.com>

* fix(l10n): Update translations from Transifex

Signed-off-by: Nextcloud bot <bot@nextcloud.com>

* fix(l10n): Update translations from Transifex

Signed-off-by: Nextcloud bot <bot@nextcloud.com>

* feat(user_oidc): Add provider_id/sub columns and getByProviderAndSub()

Store the provider and OIDC subject claim a user was provisioned from
alongside the (possibly hashed) user_id, and look accounts up by this
(provider_id, sub) pair first in getOrCreate(). This keeps a
provider's own attribute drift (e.g. the mapped uid attribute
changing) from forking the account into a second, empty one.

Existing rows are backfilled opportunistically on next login, since
the original sub is not recoverable from a one-way hashed user_id.

Signed-off-by: Carl Schwan <carl@carlschwan.eu>

* chore: Release 8.11.0

Signed-off-by: Carl Schwan <carl@carlschwan.eu>

* test(JUN-2067): fix CI after the v8.11.0 merge

- BackendTest (new upstream test) expected the upstream `user_oidc` config
  key; the fork reads `junovy_user_oidc`
- regenerate openapi.json for the renamed OCS routes and the resync-groups
  endpoint (the openapi CI job diffs it)
- replace the deprecated `->will($this->returnValueMap())` with
  `->willReturnMap()` in ProvisioningServiceTest
- gitignore the local .serena/ tool directory (it tripped the REUSE hook)

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RHatviitWzmjcMb37xoxJH

* fix(JUN-2067): address local review findings on the v8.11.0 merge

- Version080101 lazy-config migration: convert every setting from
  ProviderService::getSupportedSettings() instead of upstream's hard-coded
  copy. Reading a non-lazy value with lazy: true returns the default, so
  the fork's per-provider settings (URL overrides, TLS verify, cache
  times, ...) would have silently reset on upgrade
- UserMapper::getOrCreate(): resolve legacy accounts whose user_id is the
  raw Keycloak sub (provisioned before unique user IDs) and backfill
  provider_id/sub, instead of forking them into a second empty account.
  Same fallback ReconciliationService already uses. Test added
- ProvisioningService: the soft-provisioning display-name update looked
  the backend user up with getOrCreate($providerId, $uid), which treats
  the uid as the sub and can insert a bogus row; use getUser($uid)
- Backend: a JWKS/JWT failure while checking the group whitelist of a
  bearer token now denies the token instead of aborting the request

Not changed: the Entra ID Graph URL and the session timestamp coercion
flagged by the review are upstream code paths we do not use.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RHatviitWzmjcMb37xoxJH

* test(JUN-2067): expect the legacy raw-sub lookup in UserMapperTest::testCreate

getOrCreate() now tries the raw sub as user_id after the computed uid
misses, so new-user creation does two lookups when they differ.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RHatviitWzmjcMb37xoxJH

* test(JUN-2067): no legacy raw-sub lookup for subs over 64 chars

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RHatviitWzmjcMb37xoxJH

* ci(JUN-2067): use ubuntu-latest instead of Nextcloud's ubuntu-latest-low runner label

The label only exists in the nextcloud org; here the fixup, psalm and
auto-merge jobs queued forever and kept the PR merge state UNSTABLE.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RHatviitWzmjcMb37xoxJH

---------

Signed-off-by: nfebe <fenn25.fn@gmail.com>
Signed-off-by: Strobel Pierre <strobelpierre@gmail.com>
Signed-off-by: Carl Schwan <carlschwan@kde.org>
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
Signed-off-by: Han Gerrits <han@newtech.studio>
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
Signed-off-by: Johan Bernhardsson <johan.bernhardsson@redpill-linpro.com>
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
Signed-off-by: SAY-5 <say.apm35@gmail.com>
Signed-off-by: Spitap <dev@asdrip.fr>
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: JATippit <11259172+JATippit@users.noreply.github.com>
Signed-off-by: s3n-w6i <37022952+s3n-w6i@users.noreply.github.com>
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Signed-off-by: mostafa <mostafakhaki00@gmail.com>
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
Co-authored-by: Julien Veyssier <julien-nc@posteo.net>
Co-authored-by: nfebe <fenn25.fn@gmail.com>
Co-authored-by: Strobel Pierre <strobelpierre@gmail.com>
Co-authored-by: Carl Schwan <carlschwan@kde.org>
Co-authored-by: Han Gerrits <han@gerrits.net>
Co-authored-by: Han Gerrits <han@newtech.studio>
Co-authored-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Nextcloud bot <bot@nextcloud.com>
Co-authored-by: Johan Bernhardsson <johan.bernhardsson@redpill-linpro.com>
Co-authored-by: Carl Schwan <carl@carlschwan.eu>
Co-authored-by: SAY-5 <say.apm35@gmail.com>
Co-authored-by: Spitap <dev@asdrip.fr>
Co-authored-by: Joas Schilling <coding@schilljs.com>
Co-authored-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
Co-authored-by: Jonas <jonas@freesources.org>
Co-authored-by: JATippit <11259172+JATippit@users.noreply.github.com>
Co-authored-by: s3n-w6i <37022952+s3n-w6i@users.noreply.github.com>
Co-authored-by: mostafa <mostafakhaki00@gmail.com>
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Maxence Lange <maxence@artificial-owl.com>
Co-authored-by: Peter R. <peter.ringelmann@nextcloud.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants