Skip to content

Commit

Permalink
Merge pull request #780 from assimbly/bugfix/issue-779/mongodb---secr…
Browse files Browse the repository at this point in the history
…etkey-on-a-property-file

MongoDB - SecretKey on a property file
  • Loading branch information
brunovg committed May 30, 2023
2 parents f4a7e6d + 3f54477 commit cc745e6
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ private JwtBuilder() {
* @throws UnsupportedEncodingException when the encoding used to sign the token is not supported.
*/
public static String build(String name, String scope) throws UnsupportedEncodingException {
String key = ConfigHelper.get("secretKey");
String key = System.getenv("MONGO_SECRET_KEY");
int expiration = Integer.parseInt(ConfigHelper.get("expiration"));

return Jwts.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public static boolean validJwt(String jwt) {
* @throws UnsupportedEncodingException when the encoding used to sign the token is not supported.
*/
public static Claims decode(String jwt) throws JwtException, UnsupportedEncodingException {
String key = ConfigHelper.get("secretKey");
String key = System.getenv("MONGO_SECRET_KEY");

return Jwts.parser()
.setSigningKey(key.getBytes("UTF-8"))
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/org.assimbly.auth.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
secretKey=xxxxxxxxxxxxxxxxxxx
expiration=3600
baseDatabaseName=base

0 comments on commit cc745e6

Please sign in to comment.