Struct openidconnect::IdTokenClaims
source · pub struct IdTokenClaims<AC, GC>where
AC: AdditionalClaims,
GC: GenderClaim,{ /* private fields */ }
Expand description
OpenID Connect ID token claims.
Implementations§
source§impl<AC, GC> IdTokenClaims<AC, GC>where
AC: AdditionalClaims,
GC: GenderClaim,
impl<AC, GC> IdTokenClaims<AC, GC>where
AC: AdditionalClaims,
GC: GenderClaim,
sourcepub fn new(
issuer: IssuerUrl,
audiences: Vec<Audience>,
expiration: DateTime<Utc>,
issue_time: DateTime<Utc>,
standard_claims: StandardClaims<GC>,
additional_claims: AC
) -> Self
pub fn new( issuer: IssuerUrl, audiences: Vec<Audience>, expiration: DateTime<Utc>, issue_time: DateTime<Utc>, standard_claims: StandardClaims<GC>, additional_claims: AC ) -> Self
Initializes new ID token claims.
sourcepub fn set_issuer(self, issuer: IssuerUrl) -> Self
pub fn set_issuer(self, issuer: IssuerUrl) -> Self
Sets the iss
claim.
sourcepub fn set_audiences(self, audiences: Vec<Audience>) -> Self
pub fn set_audiences(self, audiences: Vec<Audience>) -> Self
Sets the aud
claim.
sourcepub fn expiration(&self) -> DateTime<Utc>
pub fn expiration(&self) -> DateTime<Utc>
Returns the exp
claim.
sourcepub fn set_expiration(self, expiration: DateTime<Utc>) -> Self
pub fn set_expiration(self, expiration: DateTime<Utc>) -> Self
Sets the exp
claim.
sourcepub fn issue_time(&self) -> DateTime<Utc>
pub fn issue_time(&self) -> DateTime<Utc>
Returns the iat
claim.
sourcepub fn set_issue_time(self, issue_time: DateTime<Utc>) -> Self
pub fn set_issue_time(self, issue_time: DateTime<Utc>) -> Self
Sets the iat
claim.
sourcepub fn set_auth_time(self, auth_time: Option<DateTime<Utc>>) -> Self
pub fn set_auth_time(self, auth_time: Option<DateTime<Utc>>) -> Self
Sets the auth_time
claim.
sourcepub fn auth_context_ref(&self) -> Option<&AuthenticationContextClass>
pub fn auth_context_ref(&self) -> Option<&AuthenticationContextClass>
Returns the acr
claim.
sourcepub fn set_auth_context_ref(
self,
auth_context_ref: Option<AuthenticationContextClass>
) -> Self
pub fn set_auth_context_ref( self, auth_context_ref: Option<AuthenticationContextClass> ) -> Self
Sets the acr
claim.
sourcepub fn auth_method_refs(&self) -> Option<&Vec<AuthenticationMethodReference>>
pub fn auth_method_refs(&self) -> Option<&Vec<AuthenticationMethodReference>>
Returns the amr
claim.
sourcepub fn set_auth_method_refs(
self,
auth_method_refs: Option<Vec<AuthenticationMethodReference>>
) -> Self
pub fn set_auth_method_refs( self, auth_method_refs: Option<Vec<AuthenticationMethodReference>> ) -> Self
Sets the amr
claim.
Returns the azp
claim.
Sets the azp
claim.
sourcepub fn access_token_hash(&self) -> Option<&AccessTokenHash>
pub fn access_token_hash(&self) -> Option<&AccessTokenHash>
Returns the at_hash
claim.
sourcepub fn set_access_token_hash(
self,
access_token_hash: Option<AccessTokenHash>
) -> Self
pub fn set_access_token_hash( self, access_token_hash: Option<AccessTokenHash> ) -> Self
Sets the at_hash
claim.
sourcepub fn code_hash(&self) -> Option<&AuthorizationCodeHash>
pub fn code_hash(&self) -> Option<&AuthorizationCodeHash>
Returns the c_hash
claim.
sourcepub fn set_code_hash(self, code_hash: Option<AuthorizationCodeHash>) -> Self
pub fn set_code_hash(self, code_hash: Option<AuthorizationCodeHash>) -> Self
Sets the c_hash
claim.
sourcepub fn subject(&self) -> &SubjectIdentifier
pub fn subject(&self) -> &SubjectIdentifier
Returns the sub
claim.
sourcepub fn set_subject(self, subject: SubjectIdentifier) -> Self
pub fn set_subject(self, subject: SubjectIdentifier) -> Self
Sets the sub
claim.
sourcepub fn name(&self) -> Option<&LocalizedClaim<EndUserName>>
pub fn name(&self) -> Option<&LocalizedClaim<EndUserName>>
Returns the name
claim.
sourcepub fn set_name(self, name: Option<LocalizedClaim<EndUserName>>) -> Self
pub fn set_name(self, name: Option<LocalizedClaim<EndUserName>>) -> Self
Sets the name
claim.
sourcepub fn given_name(&self) -> Option<&LocalizedClaim<EndUserGivenName>>
pub fn given_name(&self) -> Option<&LocalizedClaim<EndUserGivenName>>
Returns the given_name
claim.
sourcepub fn set_given_name(
self,
given_name: Option<LocalizedClaim<EndUserGivenName>>
) -> Self
pub fn set_given_name( self, given_name: Option<LocalizedClaim<EndUserGivenName>> ) -> Self
Sets the given_name
claim.
sourcepub fn family_name(&self) -> Option<&LocalizedClaim<EndUserFamilyName>>
pub fn family_name(&self) -> Option<&LocalizedClaim<EndUserFamilyName>>
Returns the family_name
claim.
sourcepub fn set_family_name(
self,
family_name: Option<LocalizedClaim<EndUserFamilyName>>
) -> Self
pub fn set_family_name( self, family_name: Option<LocalizedClaim<EndUserFamilyName>> ) -> Self
Sets the family_name
claim.
sourcepub fn middle_name(&self) -> Option<&LocalizedClaim<EndUserMiddleName>>
pub fn middle_name(&self) -> Option<&LocalizedClaim<EndUserMiddleName>>
Returns the middle_name
claim.
sourcepub fn set_middle_name(
self,
middle_name: Option<LocalizedClaim<EndUserMiddleName>>
) -> Self
pub fn set_middle_name( self, middle_name: Option<LocalizedClaim<EndUserMiddleName>> ) -> Self
Sets the middle_name
claim.
sourcepub fn nickname(&self) -> Option<&LocalizedClaim<EndUserNickname>>
pub fn nickname(&self) -> Option<&LocalizedClaim<EndUserNickname>>
Returns the nickname
claim.
sourcepub fn set_nickname(
self,
nickname: Option<LocalizedClaim<EndUserNickname>>
) -> Self
pub fn set_nickname( self, nickname: Option<LocalizedClaim<EndUserNickname>> ) -> Self
Sets the nickname
claim.
sourcepub fn preferred_username(&self) -> Option<&EndUserUsername>
pub fn preferred_username(&self) -> Option<&EndUserUsername>
Returns the preferred_username
claim.
sourcepub fn set_preferred_username(
self,
preferred_username: Option<EndUserUsername>
) -> Self
pub fn set_preferred_username( self, preferred_username: Option<EndUserUsername> ) -> Self
Sets the preferred_username
claim.
sourcepub fn profile(&self) -> Option<&LocalizedClaim<EndUserProfileUrl>>
pub fn profile(&self) -> Option<&LocalizedClaim<EndUserProfileUrl>>
Returns the profile
claim.
sourcepub fn set_profile(
self,
profile: Option<LocalizedClaim<EndUserProfileUrl>>
) -> Self
pub fn set_profile( self, profile: Option<LocalizedClaim<EndUserProfileUrl>> ) -> Self
Sets the profile
claim.
sourcepub fn picture(&self) -> Option<&LocalizedClaim<EndUserPictureUrl>>
pub fn picture(&self) -> Option<&LocalizedClaim<EndUserPictureUrl>>
Returns the picture
claim.
sourcepub fn set_picture(
self,
picture: Option<LocalizedClaim<EndUserPictureUrl>>
) -> Self
pub fn set_picture( self, picture: Option<LocalizedClaim<EndUserPictureUrl>> ) -> Self
Sets the picture
claim.
sourcepub fn website(&self) -> Option<&LocalizedClaim<EndUserWebsiteUrl>>
pub fn website(&self) -> Option<&LocalizedClaim<EndUserWebsiteUrl>>
Returns the website
claim.
sourcepub fn set_website(
self,
website: Option<LocalizedClaim<EndUserWebsiteUrl>>
) -> Self
pub fn set_website( self, website: Option<LocalizedClaim<EndUserWebsiteUrl>> ) -> Self
Sets the website
claim.
sourcepub fn email(&self) -> Option<&EndUserEmail>
pub fn email(&self) -> Option<&EndUserEmail>
Returns the email
claim.
sourcepub fn set_email(self, email: Option<EndUserEmail>) -> Self
pub fn set_email(self, email: Option<EndUserEmail>) -> Self
Sets the email
claim.
sourcepub fn email_verified(&self) -> Option<bool>
pub fn email_verified(&self) -> Option<bool>
Returns the email_verified
claim.
sourcepub fn set_email_verified(self, email_verified: Option<bool>) -> Self
pub fn set_email_verified(self, email_verified: Option<bool>) -> Self
Sets the email_verified
claim.
sourcepub fn set_gender(self, gender: Option<GC>) -> Self
pub fn set_gender(self, gender: Option<GC>) -> Self
Sets the gender
claim.
sourcepub fn birthday(&self) -> Option<&EndUserBirthday>
pub fn birthday(&self) -> Option<&EndUserBirthday>
Returns the birthday
claim.
sourcepub fn set_birthday(self, birthday: Option<EndUserBirthday>) -> Self
pub fn set_birthday(self, birthday: Option<EndUserBirthday>) -> Self
Sets the birthday
claim.
sourcepub fn birthdate(&self) -> Option<&EndUserBirthday>
pub fn birthdate(&self) -> Option<&EndUserBirthday>
Returns the birthdate
claim.
sourcepub fn set_birthdate(self, birthdate: Option<EndUserBirthday>) -> Self
pub fn set_birthdate(self, birthdate: Option<EndUserBirthday>) -> Self
Sets the birthdate
claim.
sourcepub fn zoneinfo(&self) -> Option<&EndUserTimezone>
pub fn zoneinfo(&self) -> Option<&EndUserTimezone>
Returns the zoneinfo
claim.
sourcepub fn set_zoneinfo(self, zoneinfo: Option<EndUserTimezone>) -> Self
pub fn set_zoneinfo(self, zoneinfo: Option<EndUserTimezone>) -> Self
Sets the zoneinfo
claim.
sourcepub fn locale(&self) -> Option<&LanguageTag>
pub fn locale(&self) -> Option<&LanguageTag>
Returns the locale
claim.
sourcepub fn set_locale(self, locale: Option<LanguageTag>) -> Self
pub fn set_locale(self, locale: Option<LanguageTag>) -> Self
Sets the locale
claim.
sourcepub fn phone_number(&self) -> Option<&EndUserPhoneNumber>
pub fn phone_number(&self) -> Option<&EndUserPhoneNumber>
Returns the phone_number
claim.
sourcepub fn set_phone_number(self, phone_number: Option<EndUserPhoneNumber>) -> Self
pub fn set_phone_number(self, phone_number: Option<EndUserPhoneNumber>) -> Self
Sets the phone_number
claim.
sourcepub fn phone_number_verified(&self) -> Option<bool>
pub fn phone_number_verified(&self) -> Option<bool>
Returns the phone_number_verified
claim.
sourcepub fn set_phone_number_verified(
self,
phone_number_verified: Option<bool>
) -> Self
pub fn set_phone_number_verified( self, phone_number_verified: Option<bool> ) -> Self
Sets the phone_number_verified
claim.
sourcepub fn address(&self) -> Option<&AddressClaim>
pub fn address(&self) -> Option<&AddressClaim>
Returns the address
claim.
sourcepub fn set_address(self, address: Option<AddressClaim>) -> Self
pub fn set_address(self, address: Option<AddressClaim>) -> Self
Sets the address
claim.
sourcepub fn updated_at(&self) -> Option<DateTime<Utc>>
pub fn updated_at(&self) -> Option<DateTime<Utc>>
Returns the updated_at
claim.
sourcepub fn set_updated_at(self, updated_at: Option<DateTime<Utc>>) -> Self
pub fn set_updated_at(self, updated_at: Option<DateTime<Utc>>) -> Self
Sets the updated_at
claim.
sourcepub fn additional_claims(&self) -> &AC
pub fn additional_claims(&self) -> &AC
Returns additional ID token claims.
sourcepub fn additional_claims_mut(&mut self) -> &mut AC
pub fn additional_claims_mut(&mut self) -> &mut AC
Returns mutable additional ID token claims.
Trait Implementations§
source§impl<AC, GC> Clone for IdTokenClaims<AC, GC>
impl<AC, GC> Clone for IdTokenClaims<AC, GC>
source§fn clone(&self) -> IdTokenClaims<AC, GC>
fn clone(&self) -> IdTokenClaims<AC, GC>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<AC, GC> Debug for IdTokenClaims<AC, GC>
impl<AC, GC> Debug for IdTokenClaims<AC, GC>
source§impl<'de, AC, GC> Deserialize<'de> for IdTokenClaims<AC, GC>where
AC: AdditionalClaims,
GC: GenderClaim,
impl<'de, AC, GC> Deserialize<'de> for IdTokenClaims<AC, GC>where
AC: AdditionalClaims,
GC: GenderClaim,
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>,
source§impl<AC, GC> PartialEq for IdTokenClaims<AC, GC>
impl<AC, GC> PartialEq for IdTokenClaims<AC, GC>
source§fn eq(&self, other: &IdTokenClaims<AC, GC>) -> bool
fn eq(&self, other: &IdTokenClaims<AC, GC>) -> bool
self
and other
values to be equal, and is used
by ==
.