Skip to content

Commit

Permalink
Merge pull request #532 from tanvi029/set-leeway
Browse files Browse the repository at this point in the history
jwt leeway time added
  • Loading branch information
Gokul-KG authored Sep 4, 2024
2 parents 4e0e28b + d6f5900 commit a69bcea
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ public void start() throws Exception {
binder = new ServiceBinder(vertx);

JWTAuthOptions jwtAuthOptions = new JWTAuthOptions();
jwtAuthOptions.getJWTOptions().setLeeway(30);
jwtAuthOptions.addPubSecKey(
new PubSecKeyOptions().setAlgorithm("ES256").setBuffer(cert));
/*
Expand All @@ -84,7 +85,7 @@ public void start() throws Exception {
config().getBoolean("jwtIgnoreExpiry") != null
&& config().getBoolean("jwtIgnoreExpiry");
if (jwtIgnoreExpiry) {
jwtAuthOptions.getJWTOptions().setIgnoreExpiration(true);
jwtAuthOptions.getJWTOptions().setIgnoreExpiration(true).setLeeway(30);
LOGGER.warn(
"JWT ignore expiration set to true, "
+ "do not set IgnoreExpiration in production!!");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,5 @@ public class Constants {
public static final String DID = "did";

public static final String REVOKED_CLIENT_SQL = "SELECT * FROM revoked_tokens WHERE _id='$1'";
public static final int JWT_LEEWAY_TIME = 30;
}

0 comments on commit a69bcea

Please sign in to comment.