From 154e75c6744ec5261379b8fd4ae295d7df6506c0 Mon Sep 17 00:00:00 2001 From: Giacomo Boccardo Date: Thu, 24 Oct 2024 13:28:30 +0200 Subject: [PATCH] Platform agnostic getIssuedAt (#34) Signed-off-by: Giacomo Boccardo --- .../src/main/java/it/spid/cie/oidc/helper/JWTHelper.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/starter-kit/src/main/java/it/spid/cie/oidc/helper/JWTHelper.java b/starter-kit/src/main/java/it/spid/cie/oidc/helper/JWTHelper.java index c75883f..e84d54a 100644 --- a/starter-kit/src/main/java/it/spid/cie/oidc/helper/JWTHelper.java +++ b/starter-kit/src/main/java/it/spid/cie/oidc/helper/JWTHelper.java @@ -21,8 +21,7 @@ import java.security.PrivateKey; import java.security.interfaces.RSAPublicKey; import java.text.ParseException; -import java.time.LocalDateTime; -import java.time.ZoneOffset; +import java.time.Instant; import org.json.JSONArray; import org.json.JSONObject; @@ -165,7 +164,7 @@ public static JWK getFirstJWK(JWKSet jwkSet) throws OIDCException { * @return current UTC date time as epoch seconds */ public static long getIssuedAt() { - return LocalDateTime.now().toEpochSecond(ZoneOffset.UTC); + return Instant.now().getEpochSecond(); } /**