Skip to content

Commit 7f0f36c

Browse files
committed
feat: fallback to iat if nbf does not exist
1 parent f233b2c commit 7f0f36c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/services/oidc.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,15 +97,16 @@ pub async fn authority() -> Result<Authority> {
9797
#[derive(Debug, Clone, Deserialize)]
9898
pub struct OIDCClaims {
9999
iss: jwt::Issuer,
100+
iat: UnixTime,
100101
aud: jwt::Audiences,
101-
nbf: UnixTime,
102+
nbf: Option<UnixTime>,
102103
exp: UnixTime,
103104
scope: Scope,
104105
}
105106

106107
impl jwt::CoreClaims for OIDCClaims {
107108
fn nbf(&self) -> Option<UnixTime> {
108-
Some(self.nbf)
109+
Some(self.nbf.unwrap_or(self.iat))
109110
}
110111
fn exp(&self) -> Option<UnixTime> {
111112
Some(self.exp)

0 commit comments

Comments
 (0)