pub struct TokenResponse {
pub session_id: String,
pub subject: String,
pub access_token: String,
pub access_expires_at: u64,
pub refresh_token: String,
pub refresh_expires_at: u64,
pub issued_at: u64,
pub amr: Vec<String>,
pub acr: String,
}Expand description
Response payload returned to clients after successful authentication.
Carries the absolute access/refresh expiries + the JWT’s AAL claims
so the route handler can synthesise the canonical
AuthenticateResponse { session, tokens } shape without
re-deriving them.
Fields§
§session_id: String§subject: String§access_token: String§access_expires_at: u64§refresh_token: String§refresh_expires_at: u64§issued_at: u64Issuance moment (Unix seconds). The canonical wire encodes
this as session.issuedAt; expiresIn = access_expires_at - issued_at.
amr: Vec<String>Authentication methods references — ["did"] for the
challenge-response path, augmented by step-up handlers.
acr: StringAuthentication context class — "aal1" for single-factor,
"aal2" after step-up.
Implementations§
Source§impl TokenResponse
impl TokenResponse
Sourcepub fn into_canonical(self) -> AuthenticateResponse
pub fn into_canonical(self) -> AuthenticateResponse
Convert to the canonical AuthenticateResponse { session, tokens }
wire shape. The route handler calls this once and returns
Json(token_resp.into_canonical()).
Trait Implementations§
Source§impl Debug for TokenResponse
impl Debug for TokenResponse
Source§impl Serialize for TokenResponse
impl Serialize for TokenResponse
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for TokenResponse
impl RefUnwindSafe for TokenResponse
impl Send for TokenResponse
impl Sync for TokenResponse
impl Unpin for TokenResponse
impl UnsafeUnpin for TokenResponse
impl UnwindSafe for TokenResponse
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more