Skip to content
This repository was archived by the owner on Jan 23, 2025. It is now read-only.

Commit 008baf8

Browse files
authored
Merge pull request #356 from deedee/jwttoken_update
use JWT_V3_SECRET
2 parents 5764ffc + 9ad51de commit 008baf8

File tree

8 files changed

+7
-5
lines changed

8 files changed

+7
-5
lines changed

conf/ApplicationServer.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,4 @@ SSO_COOKIE_KEY = @ApplicationServer.SSO_COOKIE_KEY@
4444
SSO_HASH_SECRET = @ApplicationServer.SSO_HASH_SECRET@
4545
SSO_DOMAIN = @ApplicationServer.SSO_DOMAIN@
4646

47-
JWT_COOKIE_KEY = @ApplicationServer.JWT_COOKIE_KEY@
4847
JWT_V3_COOKIE_KEY = @ApplicationServer.JWT_V3_COOKIE_KEY@

conf/Direct.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ LDAP_AUTH0_CONNECTION_NAME = @LDAP_AUTH0_CONNECTION_NAME@
1818
REDIRECT_URL_AUTH0 = /reg2/callback.action
1919
REG_SERVER_NAME= @REG_SERVER_NAME@
2020
JWT_VALID_ISSUERS=@JWT_VALID_ISSUERS@
21+
JWT_V3_SECRET = @JWT_V3_SECRET@
2122

2223
#Parameter whether we use login processor or not
2324
USE_LOGIN_PROCESSOR = @useLoginProcessor@

src/java/main/com/topcoder/direct/services/view/interceptors/AuthenticationInterceptor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ public String intercept(ActionInvocation invocation) throws Exception {
294294

295295
JWTToken jwtToken = null;
296296
try {
297-
jwtToken = new JWTToken(jwtCookie.getValue(),DirectProperties.CLIENT_SECRET_AUTH0,
297+
jwtToken = new JWTToken(jwtCookie.getValue(),DirectProperties.JWT_V3_SECRET,
298298
DirectProperties.JWT_VALID_ISSUERS, authorizationURL, new JWTToken.Base64SecretEncoder());
299299
jwtToken.verify();
300300
} catch (TokenExpiredException e) {

src/java/main/com/topcoder/direct/services/view/processor/security/LoginProcessor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public void processRequest(LoginAction action) {
119119

120120

121121
// generate the jwt cookie
122-
DirectJWTSigner jwtSigner = new DirectJWTSigner(DirectProperties.CLIENT_SECRET_AUTH0);
122+
DirectJWTSigner jwtSigner = new DirectJWTSigner(DirectProperties.JWT_V3_SECRET);
123123

124124
Map<String, Object> claims = new HashMap<String, Object>();
125125
claims.put("iss", "https://" + DirectProperties.DOMAIN_AUTH0);

src/java/main/com/topcoder/direct/services/view/processor/security/MockLoginProcessor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ public void processRequest(LoginAction action) {
200200
action.getFormData().isRemember());
201201

202202
// generate the jwt cookie
203-
DirectJWTSigner jwtSigner = new DirectJWTSigner(DirectProperties.CLIENT_SECRET_AUTH0);
203+
DirectJWTSigner jwtSigner = new DirectJWTSigner(DirectProperties.JWT_V3_SECRET);
204204

205205
Map<String, Object> claims = new HashMap<String, Object>();
206206
claims.put("iss", "https://" + DirectProperties.DOMAIN_AUTH0);

src/java/main/com/topcoder/direct/services/view/util/DirectProperties.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public final class DirectProperties {
9999
*
100100
* @since 1.1
101101
*/
102-
public static String CLIENT_SECRET_AUTH0;
102+
public static String JWT_V3_SECRET;
103103

104104
/**
105105
* <p>

token.properties.docker

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,7 @@
324324
@DOMAIN_AUTH0@ = sma.auth0.com
325325
@CLIENT_ID_AUTH0@ = CMaBuwSnY0Vu68PLrWatvvu3iIiGPh7t
326326
@CLIENT_SECRET_AUTH0@ = ZEEIRf_aLhvbYymAMTFefoEJ_8y7ELrUaboMTmE5fQoJXEo7sxxyg8IW6gtbyKuT
327+
@JWT_V3_SECRET@ = ZEEIRf_aLhvbYymAMTFefoEJ_8y7ELrUaboMTmE5fQoJXEo7sxxyg8IW6gtbyKuT
327328
@REG_SERVER_NAME@= tc.cloud.topcoder.com
328329
@LDAP_AUTH0_CONNECTION_NAME@=vm-ldap-connection
329330
@JWT_VALID_ISSUERS@ = https://sma.auth0.com, https://newtc.auth0.com, https://topcoder-newauth.auth0.com/

token.properties.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,7 @@
388388
@DOMAIN_AUTH0@=
389389
@CLIENT_ID_AUTH0@=
390390
@CLIENT_SECRET_AUTH0@=
391+
@JWT_V3_SECRET@ = secret
391392
@JWT_EXPIRATION_SECONDS@=36000000
392393
@REG_SERVER_NAME@=tc.cloud.topcoder.com
393394
@LDAP_AUTH0_CONNECTION_NAME@=vm-ldap-connection

0 commit comments

Comments
 (0)