You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2021/10/08 17:44:41 UTC

[GitHub] [hive] vihangk1 commented on a change in pull request #2601: HIVE-25479: Browser SSO auth may fail intermittently

vihangk1 commented on a change in pull request #2601:
URL: https://github.com/apache/hive/pull/2601#discussion_r725196715



##########
File path: jdbc/src/java/org/apache/hive/jdbc/HiveConnection.java
##########
@@ -1067,33 +1069,58 @@ private void openSession() throws SQLException {
     //TODO This is a bit hacky. We piggy back on a dummy OpenSession call
     // to get the redirect response from the server. Instead its probably cleaner to
     // explicitly do a HTTP post request and get the response.
-    int numRetry = isBrowserAuthMode() ? 2 : 1;
-    for (int i=0; i<numRetry; i++) {
-      try {
-        openSession(openReq);
-      } catch (TException e) {
-        if (isSamlRedirect(e)) {
-          boolean success = doBrowserSSO();
-          if (!success) {
-            String msg = browserClient.getServerResponse() == null
-                || browserClient.getServerResponse().getMsg() == null ? ""
-                : browserClient.getServerResponse().getMsg();
+    try {
+      int numRetry = 1;
+      if (isBrowserAuthMode()) {
+        numRetry = 2;

Review comment:
       Not really. If the SAML flow fails, we would throw the exception at line 1088 or 1093 below. The second attempt at openSession only happens when the auth flow has completed and the token is received by the driver.




-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org