feat: fix wrong message Unauthorized to connect to Openproject#1018
Open
Ashim-Stha wants to merge 1 commit into
Open
feat: fix wrong message Unauthorized to connect to Openproject#1018Ashim-Stha wants to merge 1 commit into
Unauthorized to connect to Openproject#1018Ashim-Stha wants to merge 1 commit into
Conversation
saw-jan
reviewed
May 11, 2026
b8f4510 to
7c574a1
Compare
saw-jan
reviewed
May 12, 2026
9276eb7 to
d6f2af2
Compare
d6f2af2 to
e40c145
Compare
saw-jan
reviewed
May 14, 2026
saw-jan
reviewed
May 14, 2026
saw-jan
reviewed
May 14, 2026
e40c145 to
4937ef9
Compare
5823afd to
abd5d37
Compare
Signed-off-by: Ashim Shrestha <ashimshrestha2384@gmail.com>
abd5d37 to
bbed379
Compare
PHP Code CoverageCoverage after merging unauthorized-bug into release/2.11 will be
Coverage Report
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Unauthorized to connect to Openproject
saw-jan
reviewed
May 19, 2026
Comment on lines
+1750
to
+1752
| if ($authMethod === SettingsService::AUTH_METHOD_OIDC) { | ||
| $this->initUserInfo($userId, $token); | ||
| } |
Comment on lines
+1787
to
+1789
| if ($token) { | ||
| $this->initUserInfo($userId, $token); | ||
| } |
| */ | ||
| public function initUserInfo(string $userId): array { | ||
| $info = $this->request($userId, '/users/me'); | ||
| public function initUserInfo(string $userId, string $accessToken): array { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Problem
On first Nextcloud login,
getOIDCTokenfetches a valid token, savestoken_expires_at, then callsinitUserInfowhich fails with401because the user hasn't SSO'd into OpenProject yet. Sincetoken_expires_atis already saved, all subsequent requests return the cached token and skipgetOIDCTokenentirely, soinitUserInfois never retried until the token naturally expires (~15 min).Fix
initUserInfoout ofgetOIDCToken->getOIDCTokenis now only responsible for fetching and returning the token.initUserInfonow takesaccessTokendirectly and callsrawRequestinstead ofrequest-> breaking the circular dependency completely.getAccessTokencallsinitUserInfoon every request (for OIDC) untiluser_idanduser_nameare saved -> both in the cached token path and the expired token pathRelated Issue or Workpackage
Screenshots (if appropriate):
Types of changes
Checklist:
CHANGELOG.mdfile