This is an automated email from the ASF dual-hosted git repository. coheigea pushed a commit to branch coheigea/jcache in repository https://gitbox.apache.org/repos/asf/cxf.git
commit 12d40af838777b77f1185f761593ce0496fe56a8 Author: Colm O hEigeartaigh <[email protected]> AuthorDate: Tue Jun 16 15:30:32 2026 +0100 Make JCacheCodeDataProvider#removeCodeGrant atomic --- .../cxf/rs/security/oauth2/grants/code/JCacheCodeDataProvider.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/JCacheCodeDataProvider.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/JCacheCodeDataProvider.java index ed9d9823a82..e84fbcfd9b3 100644 --- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/JCacheCodeDataProvider.java +++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/JCacheCodeDataProvider.java @@ -111,9 +111,9 @@ public class JCacheCodeDataProvider extends JCacheOAuthDataProvider @Override public ServerAuthorizationCodeGrant removeCodeGrant(String code) throws OAuthServiceException { - ServerAuthorizationCodeGrant grant = getCodeGrant(code); - if (grant != null) { - grantCache.remove(code); + ServerAuthorizationCodeGrant grant = grantCache.getAndRemove(code); + if (grant != null && isExpired(grant)) { + return null; } return grant; }
