This is an automated email from the ASF dual-hosted git repository.
ngangam pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hive.git
The following commit(s) were added to refs/heads/master by this push:
new 3a12055 HIVE-25786: Auto-close browser window/tab after successful
auth with SSO (Saihemanth Gantasala via Naveen Gangam)
3a12055 is described below
commit 3a1205535bdd2a426647a7dc4911b5d85c19d0e2
Author: saihemanth <[email protected]>
AuthorDate: Tue Dec 7 12:38:34 2021 -0800
HIVE-25786: Auto-close browser window/tab after successful auth with SSO
(Saihemanth Gantasala via Naveen Gangam)
---
.../java/org/apache/hive/jdbc/saml/HiveJdbcBrowserClient.java | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/jdbc/src/java/org/apache/hive/jdbc/saml/HiveJdbcBrowserClient.java
b/jdbc/src/java/org/apache/hive/jdbc/saml/HiveJdbcBrowserClient.java
index c03c961..146bc63 100644
--- a/jdbc/src/java/org/apache/hive/jdbc/saml/HiveJdbcBrowserClient.java
+++ b/jdbc/src/java/org/apache/hive/jdbc/saml/HiveJdbcBrowserClient.java
@@ -266,7 +266,14 @@ public class HiveJdbcBrowserClient implements
IJdbcBrowserClient {
responseText =
"<!DOCTYPE html><html><head><meta charset=\"UTF-8\"/>"
+ "<title>SAML Response Received</title></head>"
- + "<body>Successfully authenticated. You may close this
window.</body></html>";
+ + "<body onload=\"waitAndClose()\">Successfully
authenticated. You may close this window.</body>" +
+ "<script>" +
+ " function waitAndClose() {" +
+ " setTimeout(function() {" +
+ " window.close()" +
+ " }, 100);" +
+ " }" +
+ "</script>"+"</html>";
} else {
responseText =
"<!DOCTYPE html><html><head><meta charset=\"UTF-8\"/>"