11/*
2- * Copyright (c) 2016-2022 , FusionAuth, All Rights Reserved
2+ * Copyright (c) 2016-2023 , FusionAuth, All Rights Reserved
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
2020import com .fasterxml .jackson .annotation .JsonAnySetter ;
2121import com .fasterxml .jackson .annotation .JsonIgnore ;
2222import com .fasterxml .jackson .annotation .JsonProperty ;
23+ import com .fasterxml .jackson .databind .annotation .JsonDeserialize ;
2324import com .fasterxml .jackson .databind .annotation .JsonSerialize ;
2425import io .fusionauth .jwt .JWTDecoder ;
2526import io .fusionauth .jwt .JWTEncoder ;
2627import io .fusionauth .jwt .TimeMachineJWTDecoder ;
2728import io .fusionauth .jwt .json .Mapper ;
29+ import io .fusionauth .jwt .json .ZonedDateTimeDeserializer ;
2830import io .fusionauth .jwt .json .ZonedDateTimeSerializer ;
2931
3032import java .math .BigDecimal ;
@@ -71,6 +73,7 @@ public class JWT {
7173 * processing. The expiration time is expected to provided in UNIX time, or the number of seconds since Epoch.
7274 */
7375 @ JsonProperty ("exp" )
76+ @ JsonDeserialize (using = ZonedDateTimeDeserializer .class )
7477 @ JsonSerialize (using = ZonedDateTimeSerializer .class )
7578 public ZonedDateTime expiration ;
7679
@@ -81,6 +84,7 @@ public class JWT {
8184 * UNIX time, or the number of seconds since Epoch.
8285 */
8386 @ JsonProperty ("iat" )
87+ @ JsonDeserialize (using = ZonedDateTimeDeserializer .class )
8488 @ JsonSerialize (using = ZonedDateTimeSerializer .class )
8589 public ZonedDateTime issuedAt ;
8690
@@ -97,9 +101,10 @@ public class JWT {
97101 * Registered Claim <code>nbf</code> as defined by RFC 7519 Section 4.1.5. Use of this claim is OPTIONAL.
98102 * <p>
99103 * This claim identifies the time before which the JWT MUST NOT be accepted for processing. The not before value is
100- * expected to provided in UNIX time, or the number of seconds since Epoch.
104+ * expected to be provided in UNIX time, or the number of seconds since Epoch.
101105 */
102106 @ JsonProperty ("nbf" )
107+ @ JsonDeserialize (using = ZonedDateTimeDeserializer .class )
103108 @ JsonSerialize (using = ZonedDateTimeSerializer .class )
104109 public ZonedDateTime notBefore ;
105110
0 commit comments