pub struct IdTokenClaims {Show 13 fields
pub iss: String,
pub sub: String,
pub aud: OneOrMany,
pub exp: i64,
pub iat: i64,
pub nonce: Option<String>,
pub auth_time: Option<i64>,
pub azp: Option<String>,
pub tenant: Option<String>,
pub name: Option<String>,
pub email: Option<String>,
pub email_verified: Option<bool>,
pub preferred_username: Option<String>,
}Expand description
OIDC ID Token claims (OpenID Connect Core 1.0, Section 2).
Separate from Claims because:
audis theclient_id(not the resource indicator)- Includes user profile claims (name, email)
- Only issued by the OAuth token endpoint, not used in the RPC layer
- Different
typheader ("JWT"vs"at+jwt"for access tokens)
Fields§
§iss: StringIssuer URL.
sub: StringSubject identifier — a stable UUID, not a username.
aud: OneOrManyAudience — the client_id. Supports single string or array.
exp: i64Expiration time (Unix timestamp).
iat: i64Issued at (Unix timestamp).
nonce: Option<String>OIDC nonce echoed from the authorization request.
auth_time: Option<i64>Time of user authentication (Unix timestamp).
azp: Option<String>Authorized party (REQUIRED when aud has multiple values).
tenant: Option<String>Authority-verified hosted-account tenant for local token exchange.
name: Option<String>Full name.
email: Option<String>Email address.
email_verified: Option<bool>Whether the email is verified.
preferred_username: Option<String>Preferred display username.
Implementations§
Source§impl IdTokenClaims
impl IdTokenClaims
Sourcepub fn new(iss: String, sub: String, aud: String, iat: i64, exp: i64) -> Self
pub fn new(iss: String, sub: String, aud: String, iat: i64, exp: i64) -> Self
Create minimal id_token claims (required fields only).
Sourcepub fn with_nonce(self, nonce: Option<String>) -> Self
pub fn with_nonce(self, nonce: Option<String>) -> Self
Set the OIDC nonce (echoed from the authorization request).
Sourcepub fn with_auth_time(self, auth_time: i64) -> Self
pub fn with_auth_time(self, auth_time: i64) -> Self
Set the authentication time.
Sourcepub fn with_tenant(self, tenant: String) -> Self
pub fn with_tenant(self, tenant: String) -> Self
Bind this local ID token to the user’s hosted-account tenant.
Trait Implementations§
Source§impl Clone for IdTokenClaims
impl Clone for IdTokenClaims
Source§fn clone(&self) -> IdTokenClaims
fn clone(&self) -> IdTokenClaims
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
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>,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more