Skip to content

Commit 533d5af

Browse files
authored
Merge pull request #103 from topcoder-platform/hotfix/new-auth
Master (HotFix): new auth changes - 29 Oct 2020
2 parents 0e41fe9 + 65fc8a6 commit 533d5af

File tree

4 files changed

+34
-1
lines changed

4 files changed

+34
-1
lines changed

conf/OnlineReview.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5311,6 +5311,11 @@
53115311
<Value>@aws_s3_bucket_dmz@</Value>
53125312
</Property>
53135313
</Property>
5314+
<Property name="new_auth">
5315+
<Property name="new_auth_url">
5316+
<Value>@new_auth_url@</Value>
5317+
</Property>
5318+
</Property>
53145319
</Config>
53155320

53165321
<!--

src/java/main/com/cronos/onlinereview/util/ConfigHelper.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,6 +1070,11 @@ public class ConfigHelper {
10701070
* JWT default expiration time (1 day)
10711071
*/
10721072
private static final int DEFAULT_EXPIRATION_TIME = 60 * 24;
1073+
1074+
/**
1075+
* New Auth URL for Iframe to refresh the RS256 token
1076+
*/
1077+
private static String newAuthUrl;
10731078

10741079
static {
10751080
// Obtaining the instance of Configuration Manager
@@ -1698,6 +1703,10 @@ public class ConfigHelper {
16981703
} catch (Exception e) {
16991704
preSignedExpTimeMilis = 60 * 60 * 1000;
17001705
}
1706+
1707+
Property newAuth = cfgMgr.getPropertyObject(ONLINE_REVIEW_CFG_NS, "new_auth");
1708+
newAuthUrl = newAuth.getValue("new_auth_url");
1709+
17011710
} catch (UnknownNamespaceException une) {
17021711
System.out.println(une.getMessage());
17031712
une.printStackTrace();
@@ -2657,4 +2666,12 @@ public static String getS3BucketDmz() {
26572666
public static long getPreSignedExpTimeMilis() {
26582667
return preSignedExpTimeMilis;
26592668
}
2669+
2670+
/**
2671+
* Get new auth url
2672+
* @return url
2673+
*/
2674+
public static String getNewAuthUrl() {
2675+
return newAuthUrl;
2676+
}
26602677
}

web/includes/inc_footer.jsp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,14 @@ analytics.identify('', {
5050
});
5151
</script>
5252

53+
<script>
54+
function prepareFrame() {
55+
var ifrm = document.createElement("iframe");
56+
ifrm.setAttribute("src", "<%=com.cronos.onlinereview.util.ConfigHelper.getNewAuthUrl()%>");
57+
ifrm.style.width = "0px";
58+
ifrm.style.height = "0px";
59+
document.body.appendChild(ifrm);
60+
}
61+
window.onload = prepareFrame;
62+
</script>
63+

web/includes/inc_header.jsp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
</script>
5555

5656
<a href="javascript:;" class="social-login">Social login</a>
57-
| <a href="http://<%=ApplicationServer.SERVER_NAME%>/login/?next=https://<%=ApplicationServer.SOFTWARE_SERVER_NAME%>/review">Login</a>
57+
| <a href="http://<%=com.cronos.onlinereview.util.ConfigHelper.getNewAuthUrl()%>?retUrl=https://<%=ApplicationServer.SOFTWARE_SERVER_NAME%>/review">Login</a>
5858
| <a href="http://<%=ApplicationServer.SERVER_NAME%>/reg/">Register</a>
5959
| <a href="http://<%=ApplicationServer.SERVER_NAME%>/">Home</a>
6060
</c:if>

0 commit comments

Comments
 (0)