You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2023/01/15 14:46:02 UTC

[sling-whiteboard] branch master updated: servlets.oidc-rp: fix access token expiration check

This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-whiteboard.git


The following commit(s) were added to refs/heads/master by this push:
     new 1e53d39f servlets.oidc-rp: fix access token expiration check
1e53d39f is described below

commit 1e53d39f244a10783abca4b9f47dcd0cf29708bf
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Sun Jan 15 15:45:29 2023 +0100

    servlets.oidc-rp: fix access token expiration check
---
 .../apache/sling/servlets/oidc_rp/impl/OidcConnectionFinderImpl.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/org.apache.sling.servlets.oidc-rp/src/main/java/org/apache/sling/servlets/oidc_rp/impl/OidcConnectionFinderImpl.java b/org.apache.sling.servlets.oidc-rp/src/main/java/org/apache/sling/servlets/oidc_rp/impl/OidcConnectionFinderImpl.java
index 70c49d15..a900da8c 100644
--- a/org.apache.sling.servlets.oidc-rp/src/main/java/org/apache/sling/servlets/oidc_rp/impl/OidcConnectionFinderImpl.java
+++ b/org.apache.sling.servlets.oidc-rp/src/main/java/org/apache/sling/servlets/oidc_rp/impl/OidcConnectionFinderImpl.java
@@ -62,7 +62,7 @@ public class OidcConnectionFinderImpl implements OidcConnectionFinder, OidcConne
             Value[] expiresAt = user.getProperty(propertyPath(PROPERTY_NAME_EXPIRES_AT));
             if ( expiresAt != null  && expiresAt.length == 1 && expiresAt[0].getType() == PropertyType.DATE ) {
                 Calendar expiresCal = expiresAt[0].getDate();
-                if ( expiresCal.after(Calendar.getInstance())) {
+                if ( expiresCal.before(Calendar.getInstance())) {
                     logger.info("Token for {} expired at {}, removing", connection.name(), expiresCal);
                     user.removeProperty(nodePath()); // unsure if this will work ...
                     return Optional.empty();