jchen21 commented on a change in pull request #6927:
URL: https://github.com/apache/geode/pull/6927#discussion_r720596318



##########
File path: 
geode-core/src/main/java/org/apache/geode/cache/client/internal/AuthenticateUserOp.java
##########
@@ -176,13 +177,29 @@ protected InternalDistributedSystem getConnectedSystem() {
 
     @Override
     public Object attempt(Connection connection) throws Exception {
-      if (connection.getServer().getRequiresCredentials()) {
-        return super.attempt(connection);
-      } else {
+      if (!connection.getServer().getRequiresCredentials()) {
         return null;
       }
+
+      try {
+        return parentAttempt(connection);
+      }
+      // if login failed for auth expired reason, try again once more
+      catch (AuthenticationExpiredException first) {
+        getMessage().clear();
+        try {
+          return parentAttempt(connection);
+        } catch (AuthenticationExpiredException second) {
+          throw new AuthenticationFailedException(second.getMessage(), second);
+        }
+      }
+    }
+
+    Object parentAttempt(Connection connection) throws Exception {

Review comment:
       `@VisibleForTesting`




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to