Add auth_time
This commit is contained in:
parent
4390605586
commit
d3d3f0163c
@ -1,5 +1,6 @@
|
|||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use async_trait::async_trait;
|
use async_trait::async_trait;
|
||||||
|
use chrono::{offset::Utc, DateTime};
|
||||||
use openidconnect::{Nonce, RedirectUrl};
|
use openidconnect::{Nonce, RedirectUrl};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
@ -21,6 +22,7 @@ pub struct CodeEntry {
|
|||||||
pub address: String,
|
pub address: String,
|
||||||
pub nonce: Option<Nonce>,
|
pub nonce: Option<Nonce>,
|
||||||
pub client_id: String,
|
pub client_id: String,
|
||||||
|
pub auth_time: DateTime<Utc>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Serialize, Deserialize)]
|
#[derive(Clone, Serialize, Deserialize)]
|
||||||
|
@ -214,7 +214,8 @@ pub async fn token(
|
|||||||
StandardClaims::new(SubjectIdentifier::new(code_entry.address)),
|
StandardClaims::new(SubjectIdentifier::new(code_entry.address)),
|
||||||
EmptyAdditionalClaims {},
|
EmptyAdditionalClaims {},
|
||||||
)
|
)
|
||||||
.set_nonce(code_entry.nonce);
|
.set_nonce(code_entry.nonce)
|
||||||
|
.set_auth_time(Some(code_entry.auth_time));
|
||||||
|
|
||||||
let pem = private_key
|
let pem = private_key
|
||||||
.to_pkcs1_pem()
|
.to_pkcs1_pem()
|
||||||
@ -460,6 +461,7 @@ pub async fn sign_in(
|
|||||||
nonce: params.oidc_nonce.clone(),
|
nonce: params.oidc_nonce.clone(),
|
||||||
exchange_count: 0,
|
exchange_count: 0,
|
||||||
client_id: params.client_id.clone(),
|
client_id: params.client_id.clone(),
|
||||||
|
auth_time: chrono::offset::Utc::now(),
|
||||||
};
|
};
|
||||||
|
|
||||||
let code = Uuid::new_v4();
|
let code = Uuid::new_v4();
|
||||||
|
Loading…
Reference in New Issue
Block a user