There are 2 updates, 2 comments.
 
 
OpenId Connect / cid:jira-generated-image-avatar-c9b0461c-3887-4a85-9ea1-e32408491e8b OIDC-298 Open

OIDC Extension Manager action can fail due to stale classloader after dependency changes

 
View issue   ยท   Add comment
 

2 updates

 
cid:jira-generated-image-avatar-4b6ed503-de66-4050-bc25-4134eaad2760 Changes by Nikita Petrenko on 12/Jun/26 11:02
 
Description: Tested with local demo Jetty/HSQLDB 17.10.9. And also observed same situation on old version 16.10.17.

When upgrading
, installing, uninstalling, or downgrading {{OpenID Connect Authenticator}} from an older version such as 2.20.3 (this is the version I originally used), the operation can fail because some {{OIDC/OAuth2}} classes cannot be resolved from the current classloader.

This prevents components such as {{{}OIDCConsentStore{}}}, {{{}DefaultOAuth2TokenStore{}}}, or {{OIDCUserManager}} from being initialized properly. As a result, the extension upgrade/downgrade may fail with dependency initialization errors, for example:
{noformat}
Failed to get fields for class
\ [org.xwiki.contrib.oidc.consent.internal.store.OIDCConsentStore \ ] because the class \ [org/xwiki/contrib/oidc/OIDCException \ ] couldn't be found in the ClassLoader.
Failed to get fields for class
\ [org.xwiki.contrib.oidc.internal.DefaultOAuth2TokenStore \ ] because the class \ [org/xwiki/contrib/oidc/OAuth2Exception \ ] couldn't be found in the ClassLoader.
Extension
\ [org.xwiki.contrib.oidc:oidc-authenticator/2.20.3 \ ] cannot be initialized because its dependency ( \ [org.xwiki.contrib.oidc:oauth2-store-2.20.3 \ ]) could not.{noformat}
A restart of XWiki usually resolves the issue, which suggests that the problem is related to stale extension classloaders or classes/components from the previous OIDC version still being cached during the extension operation.

However, in some cases, even restarting does not fully recover the installation state, making it impossible to install the target version. Adding note, this last situation with install I only observed randomly on 17.10.9
, whereas . on version 16.10.17 install or uninstall operation doesn't have it.
Attachment: ExtensionManager after attempt to install OpenID Connect Authenticator.jpeg
 
 

2 comments

 
cid:jira-generated-image-avatar-4b6ed503-de66-4050-bc25-4134eaad2760 Nikita Petrenko on 12/Jun/26 11:02
 
{quote}However, in some cases, even restarting does not fully recover the installation state, making it impossible to install the target version. Adding note, this last situation with install I only observed randomly on 17.10.9,
{quote}

Observing EM, I have only installed dependencies   [^ExtensionManager after attempt to install OpenID Connect Authenticator.jpeg] but not the root extension {{OpenID Connect Authenticator}}
 
cid:jira-generated-image-avatar-4b6ed503-de66-4050-bc25-4134eaad2760 Nikita Petrenko on 12/Jun/26 11:04
 
{quote}However, in some cases, even restarting does not fully recover the installation state, making it impossible to install the target version. Adding note, this last situation with install I only observed randomly on 17.10.9,
{quote}
Observing EM, I have only installed dependencies  [^ExtensionManager after attempt to install OpenID Connect Authenticator.jpeg] but not the root extension {{OpenID Connect Authenticator}}
. I didn't select during install newer version, so I don't understand why installing {{2.20.3}} I ended with installed {{org.xwiki.contrib.oidc:oidc-api}} and {{org.xwiki.contrib.oidc:oidc-consent}} latest version {{2.23.0}}