Thanks guys for the commentary here.

I wasn’t too partial on the “time claim” type. I just went for “Iat” very much 
in line with Vladimir’s guess, it was quite empirical: 

*       it comes from OIDC, and for the usual consideration that existing logic 
used for processing ID_tokens will be partially repurposed to implement some of 
the validation steps
*       “nbf” appeared as the “time claim” only in AzureAD and IS, while “iat” 
appears in AWS, OKTA, Auth0 and again Azure AD, hence it seemed the common 
choice

The slightly more philosophical, but still empirical reason is that I haven’t 
observed scenarios in which the RS defers to the AS the decision about the 
starting time for the validity of the AT, the semantic of “nbf”, whereas “iat” 
simply states a fact about the token and it’s up to the RS to decide what to do 
with it, including applying nbf sematic. That’s a decision that can be easily 
enshrined as a default in an SDK without loss of expressive power.

 

I am not married to “iat” and if there’s strong momentum for “nbf” I am open to 
change it, however we are in a second last call and we just discussed “iat” in 
the interim meeting last week, hence I thought we had pretty strong consensus 
on “iat” already. You folks tell me 😊

 

From: OAuth <oauth-boun...@ietf.org> On Behalf Of David Waite
Sent: Sunday, April 19, 2020 10:00 PM
To: Vladimir Dzhuvinov <vladi...@connect2id.com>
Cc: oauth@ietf.org
Subject: Re: [OAUTH-WG] Second WGLC on "JSON Web Token (JWT) Profile for OAuth 
2.0 Access Tokens"

 

There are a number of ambiguities and statements around using JWTs in various 
contexts:

 

1. Some implementations interpret “iat" to also have the meaning of “nbf” in 
the absence of “nbf”, although this is AFAIK not prescribed by any spec

2. The DPoP draft’s client-generated tokens have the resource servers use their 
own nbf/exp heuristics around “iat”, since the tokens are meant for immediate 
one time use by a party that may not have clock synchronization.

3. There are recommendations in the JWT profile for OAuth that the AS may 
reject tokens based on an “iat” too far in the past or “exp” too far in the 
future, but not that “nbf” was too far in the past or that the interval between 
nbf and exp was too large.

 

The JWT spec also allows implementers to provide some leeway for clock skew. 
Presumably this meant validators and not JWT creators, although there is 
history of messages setting similar values to account for clock skew (e.g. SAML 
IDPs setting notBefore to one minute before issuance and notOnOrAfter 5 minutes 
after issuance). 

 

-DW





On Apr 19, 2020, at 2:50 AM, Vladimir Dzhuvinov <vladi...@connect2id.com 
<mailto:vladi...@connect2id.com> > wrote:

 

On 16/04/2020 10:10, Dominick Baier wrote:

iat vs nbf

What’s the rationale for using iat instead of nbf. Aren’t most JWT libraries 
(including e.g. the ..NET one) looking for nbf by default?

Developers often tend to intuitively pick up "iat" over "nbf" because it sounds 
more meaningful (my private observation). So given the empirical approach of 
Vittorio to the spec, I suspect that's how "iat" got here.

If we bother to carefully look at the JWT spec we'll see that "iat" is meant to 
be "informational" whereas it's "nbf" that is intended to serve (together with 
"exp") in determining the actual validity window of the JWT.

https://tools.ietf.org/html/rfc7519#section-4.1.5

My suggestion is to require either "iat" or "nbf". That shouldn't break 
anything, and deployments that rely on one or the other to determine the 
validity window of the access token can continue using their preferred claim 
for that.

Vladimir

_______________________________________________
OAuth mailing list
OAuth@ietf.org <mailto:OAuth@ietf.org> 
https://www.ietf.org/mailman/listinfo/oauth

 

_______________________________________________
OAuth mailing list
OAuth@ietf.org
https://www.ietf.org/mailman/listinfo/oauth

Reply via email to