Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.3k views
in Technique[技术] by (71.8m points)

azure active directory - What format is the exp (Expiration Time) claim in a JWT

I am using ADAL library to get access token for a resource. Does anyone know what format is the expiration time in ? more specifically "exp" (Expiration time) claim.

JwtSecurityToken class simply returns int32 after parsing. So, that is not a good indicator.

Tried parsing it to TimeSpan and DateTime but the values are not 90 minutes apart. It's almost the same.

This is what I get from fiddler for iat and exp claim (used https://jwt.io/ to parse the token)

iat: 1475874457

exp: 1475878357

The values are not that much apart.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

RFC 7519 states that the exp and iat claim values must be NumericDate values.

NumericDate is the last definition in Section 2. Terminology, and is defined as the number of seconds (not milliseconds) since Epoch:

A JSON numeric value representing the number of seconds from 1970-01-01T00:00:00Z UTC until the specified UTC date/time, ignoring leap seconds. This is equivalent to the IEEE Std 1003.1, 2013 Edition [POSIX.1] definition "Seconds Since the Epoch", in which each day is accounted for by exactly 86400 seconds, other than that non-integer values can be represented. See RFC 3339 [RFC3339] for details regarding date/times in general and UTC in particular.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...