Add missing claim
This commit is contained in:
parent
53a540139c
commit
8a005c4185
@ -25,8 +25,13 @@ pub struct IdToken {
|
||||
pub nonce: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(serde::Serialize, serde::Deserialize)]
|
||||
pub struct CustomIdTokenClaims {
|
||||
auth_time: u64,
|
||||
}
|
||||
|
||||
impl IdToken {
|
||||
pub fn to_jwt_claims(self) -> JWTClaims<()> {
|
||||
pub fn to_jwt_claims(self) -> JWTClaims<CustomIdTokenClaims> {
|
||||
JWTClaims {
|
||||
issued_at: Some(Duration::from_secs(self.issued_at)),
|
||||
expires_at: Some(Duration::from_secs(self.expiration_time)),
|
||||
@ -36,7 +41,9 @@ impl IdToken {
|
||||
audiences: Some(Audiences::AsString(self.audience)),
|
||||
jwt_id: None,
|
||||
nonce: self.nonce,
|
||||
custom: (),
|
||||
custom: CustomIdTokenClaims {
|
||||
auth_time: self.auth_time
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user