diff options
author | Thomas <> | 2021-08-12 20:10:52 +0200 |
---|---|---|
committer | Thomas <> | 2021-08-12 20:10:52 +0200 |
commit | af4097de42e0208d19fdcee7bbfc1406b64c17c7 (patch) | |
tree | cc27b393567dac75cc044cab93a0d1d6ec6d16b4 /eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth | |
parent | 746241475fc20a424aaa0c9b0d3c18251871c4e6 (diff) | |
download | National_eIDAS_Gateway-af4097de42e0208d19fdcee7bbfc1406b64c17c7.tar.gz National_eIDAS_Gateway-af4097de42e0208d19fdcee7bbfc1406b64c17c7.tar.bz2 National_eIDAS_Gateway-af4097de42e0208d19fdcee7bbfc1406b64c17c7.zip |
fix wrong timezone in IDA authblock
Diffstat (limited to 'eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth')
-rw-r--r-- | eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/service/AuthBlockSigningService.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/service/AuthBlockSigningService.java b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/service/AuthBlockSigningService.java index a2af4342..5421bb5c 100644 --- a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/service/AuthBlockSigningService.java +++ b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/service/AuthBlockSigningService.java @@ -6,6 +6,7 @@ import java.security.KeyStoreException; import java.security.Provider; import java.security.cert.X509Certificate; import java.time.LocalDateTime; +import java.time.ZoneOffset; import java.time.temporal.ChronoUnit; import java.util.Base64; import java.util.UUID; @@ -76,10 +77,12 @@ public class AuthBlockSigningService { public String buildSignedAuthBlock(IRequest pendingReq) throws JsonProcessingException, EaafException, JoseException { + //TODO: set Challenge to SAML2 requestId to create link between authentication request and authBlock + // build AuthBlock EidasAuchBlock authBlock = new EidasAuchBlock(); authBlock.setChallenge(UUID.randomUUID().toString()); - authBlock.setTimestamp(LocalDateTime.now().truncatedTo(ChronoUnit.SECONDS)); + authBlock.setTimestamp(LocalDateTime.now(ZoneOffset.UTC).truncatedTo(ChronoUnit.SECONDS)); authBlock.setUniqueId(pendingReq.getRawData(MsEidasNodeConstants.DATA_REQUESTERID, String.class)); authBlock.setPiiTransactionId(pendingReq.getUniquePiiTransactionIdentifier()); @@ -190,7 +193,7 @@ public class AuthBlockSigningService { @JsonProperty("timestamp") @JsonSerialize(using = LocalDateTimeSerializer.class) @JsonDeserialize(using = LocalDateTimeDeserializer.class) - @JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'") + @JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", timezone = "UTC") private LocalDateTime timestamp; @JsonProperty("appId") |