Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MongoDB - SecretKey on a property file #780

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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