Repository navigation
Conversation
Delegate valid local OAuth2 bearer tokens without invoking OIDC verification. End only the local session when a refresh is rejected with invalid_grant, avoiding a second failing IdP logout request. Preserve other authentication errors and add regression coverage for cached and uncached sessions. Signed-off-by: Hendrik Linka <[email protected]>
|
|
…seconds remaining
|
Thanks a lot @H-LK for the thorough analysis and the reproducer. We could reproduce it exactly: with a session cookie, every OCS and web request that carries a local OAuth2 token cost two requests to the identity provider (discovery plus an introspection answering We'd like to fix that part in core instead of here, though. One design principle of these apps is that they don't interact with each other, so openidconnect shouldn't instantiate or query classes of the oauth2 app. The root cause is in Could you split the |
|
Thanks a lot for reproducing that — it confirms the analysis and the reproducer. As requested, I am splitting this PR into two independent, SessionVerifier-only PRs:
I agree with your call on the remaining part: the I am closing this PR in favor of #382 and #383 and will delete the |
Description
This PR addresses two separate OIDC authentication problems:
null, leaving authentication to OAuth2. Unknown tokens, absent/disabled OAuth2 and PoP retain the existing OIDC verification path. Core authentication and identity-consistency checks remain unchanged.invalid_grantby ending the local session. Remove only this verifier's logout listener to avoid another IdP request with rejected credentials. Other logout listeners still run; unrelated HTTP and transport exceptions are rethrown. The corresponding decoded error response is handled as well.The OAuth2 check uses actual token validation, not token length or shape. It adds a local token/user lookup for Bearer requests; database lookup errors are not swallowed. No new dependencies or core changes are introduced.
Related Issue
Motivation and Context
With ownCloud Server 11.0.1, OAuth2 0.7.2 and OpenID Connect 2.4.2, session-bearing requests authenticated with valid local OAuth2 tokens also entered OIDC verification and triggered unsuccessful IdP introspection.
Separately, a browser request failed with HTTP 500 after Keycloak 26.7.4 returned
invalid_grant: Token is not activefrom its token endpoint. The trace passed throughSessionVerifier::refreshToken()from the cached-expiry branch. The reason the IdP rejected that token was not established. This change handles the rejection, rather than changing token lifetime or IdP policy.How Has This Been Tested?
The isolated and HTTP harnesses are external to this PR; the regression unit tests are included. This is not a real-Keycloak, LDAP, clustered-database or production-load acceptance test. The extended HTTP harness is not fully green: an independent check fails on both baseline and candidate and needs separate follow-up outside this PR. The full upstream database CI matrix was not run locally.
Types of changes
Checklist
Open tasks
Please apply the appropriate review/backport labels and milestone where repository permissions are required.