Skip to content

Commit

Permalink
Externalize jwt, to be passed from outside container
Browse files Browse the repository at this point in the history
  • Loading branch information
mwithi committed Mar 23, 2023
1 parent 25b3f86 commit 165d36a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public class TokenProvider implements Serializable, InitializingBean {

@Override
public void afterPropertiesSet() {
String secret = "EGnA2fAHSptY0TAjoQHuBDftkwuAjYmx6jTsNXVHy38lfHc0tvcaS3fPO3QOXPhpI8"; // env.getProperty("JWT_TOKEN_SECRET");
String secret = env.getProperty("jwt.token.secret");
log.info("Initializing JWT key with secret: {}", secret);
// byte[] keyBytes = Decoders.BASE64.decode(SECRET);
byte[] keyBytes = secret.getBytes(StandardCharsets.UTF_8);
Expand Down
4 changes: 4 additions & 0 deletions patient-portal/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,7 @@ spring.flyway.check-location=true
spring.flyway.locations=filesystem:sql/migrations
spring.flyway.schemas=ohpp
spring.flyway.enabled=true

# Security token secret (JWT)
jwt.token.secret=EGnA2fAHSptY0TAjoQHuBDftkwuAjYmx6jTsNXVHy38lfHc0tvcaS3fPO3QOXPhpI8

0 comments on commit 165d36a

Please sign in to comment.