pub struct IdTokenClaims {Show 14 fields
pub iss: String,
pub sub: String,
pub aud: String,
pub exp: usize,
pub iat: usize,
pub auth_time: Option<usize>,
pub nonce: Option<String>,
pub at_hash: Option<String>,
pub c_hash: Option<String>,
pub azp: Option<String>,
pub typ: Option<String>,
pub sid: Option<String>,
pub jti: Option<String>,
pub user_claims: Value,
}Expand description
ID Token claims structure per OpenID Connect Core 1.0. Contains standard claims plus token hash values for security validation.
Fields§
§iss: StringIssuer identifier (must match the issuer URL)
sub: StringSubject identifier (unique user ID)
aud: StringAudience (client_id)
exp: usizeExpiration time
iat: usizeIssued at time
auth_time: Option<usize>Authentication time
nonce: Option<String>Nonce value from authorization request (must be echoed if present)
at_hash: Option<String>Access token hash (at_hash) - OIDC Core Section 3.2.2.9
c_hash: Option<String>Authorization code hash (c_hash) - OIDC Core Section 3.2.2.9
azp: Option<String>Authorized party (client_id)
typ: Option<String>Token type
sid: Option<String>Session ID
jti: Option<String>JWT ID
user_claims: ValueUser claims (name, email, etc.)
Implementations§
Source§impl IdTokenClaims
impl IdTokenClaims
Sourcepub fn new(
issuer: &str,
subject: &str,
audience: &str,
expires_at: usize,
issued_at: usize,
) -> Self
pub fn new( issuer: &str, subject: &str, audience: &str, expires_at: usize, issued_at: usize, ) -> Self
Create new ID token claims with standard claims.
Sourcepub fn with_nonce(self, nonce: &str) -> Self
pub fn with_nonce(self, nonce: &str) -> Self
Set nonce value.
Sourcepub fn with_at_hash(self, at_hash: &str) -> Self
pub fn with_at_hash(self, at_hash: &str) -> Self
Set access token hash (at_hash).
Sourcepub fn with_c_hash(self, c_hash: &str) -> Self
pub fn with_c_hash(self, c_hash: &str) -> Self
Set authorization code hash (c_hash).
Sourcepub fn with_user_claims(self, claims: Value) -> Self
pub fn with_user_claims(self, claims: Value) -> Self
Set user claims (name, email, picture, etc.).
Trait Implementations§
Source§impl Clone for IdTokenClaims
impl Clone for IdTokenClaims
Source§fn clone(&self) -> IdTokenClaims
fn clone(&self) -> IdTokenClaims
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for IdTokenClaims
impl Debug for IdTokenClaims
Source§impl<'de> Deserialize<'de> for IdTokenClaims
impl<'de> Deserialize<'de> for IdTokenClaims
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for IdTokenClaims
impl RefUnwindSafe for IdTokenClaims
impl Send for IdTokenClaims
impl Sync for IdTokenClaims
impl Unpin for IdTokenClaims
impl UnsafeUnpin for IdTokenClaims
impl UnwindSafe for IdTokenClaims
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