This issue has been created
 
 
OpenId Connect / cid:jira-generated-image-avatar-39b44736-114a-47a0-b03c-1a19316be267 OIDC-296 Open

Authenticator 2.22.0 — Login fails with "Cannot refresh the access token because there is no refresh token" immediately after token issuance

 
View issue   ·   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-5e368dfb-9d61-45ba-92d8-c960b59ff3e0 Maurice Fink created this issue on 04/Jun/26 11:30
 
Summary: Authenticator 2.22.0 — Login fails with "Cannot refresh the access token because there is no refresh token" immediately after token issuance
Issue Type: cid:jira-generated-image-avatar-39b44736-114a-47a0-b03c-1a19316be267 Bug
Affects Versions: 2.22.0
Assignee: Unassigned
Created: 04/Jun/26 11:30
Environment: Ubuntu 24.04 LTS
Apache Tomcat 10
OIDC Authenticator 2.22.0 (broken) / previous version (working)
Identity Provider: Shibboleth IdP — does not issue refresh tokens; offline_access scope not supported by this IdP
oidc.userinforefreshrate=0 is configured
Priority: cid:jira-generated-image-static-minor-9dd1641e-b62f-4708-bc91-be930aac3781 Minor
Reporter: Maurice Fink
Description:

After upgrading the OIDC Authenticator to 2.22.0, login via OIDC callback fails with a 500 error for all users. Downgrading to the previous version resolves the issue, confirming this is a regression introduced in 2.22.0.

Observed behavior:

The token exchange with the IdP completes successfully. The token response contains a valid access token with "expires_in":600. Immediately after — within the same second — the plugin logs:
DEBUG o.x.c.o.a.i.OIDCUserManager - The access token is expired, refreshing...
Since the IdP does not provide a refresh token, the subsequent refresh attempt fails:
InvalidAccessTokenException: Cannot refresh the access token because there is no refresh token
This causes a 500 error on the OIDC callback endpoint, making login impossible.

Relevant log excerpt:
{{08:59:21 DEBUG OIDCTokenRequestHelper - OIDC Token response ({"access_token":"...","expirese":600,...})
08:59:21 DEBUG OIDCUserManager - The access token is expired, refreshing...
08:59:21 DEBUG OIDCResourceReferenceHandler - Failed to handle the OIDC endpoint
org.xwiki.contrib.oidc.auth.internal.InvalidAccessTokenException: Cannot refresh the access token because there is no refresh token}}
Token issuance and expiry check happen in the same second, suggesting the expiry evaluation is incorrect.

Expected behavior:

A freshly issued token with expires_in:600 should not be considered expired immediately. The plugin should use it to call the UserInfo endpoint without attempting a refresh.

Workaround:

None found within 2.22.0. oidc.userinforefreshrate=0 does not prevent this code path. Downgrade to the previous version resolves the issue.

Steps to reproduce:

  1. Configure OIDC Authenticator 2.22.0 against a Shibboleth IdP that does not issue refresh tokens
  2. Attempt login
  3. Observe 500 on the OIDC callback