Struct openidconnect::IdToken
source · pub struct IdToken<AC: AdditionalClaims, GC: GenderClaim, JE: JweContentEncryptionAlgorithm<JT>, JS: JwsSigningAlgorithm<JT>, JT: JsonWebKeyType>(/* private fields */);
Expand description
OpenID Connect ID token.
Implementations§
source§impl<AC, GC, JE, JS, JT> IdToken<AC, GC, JE, JS, JT>where
AC: AdditionalClaims,
GC: GenderClaim,
JE: JweContentEncryptionAlgorithm<JT>,
JS: JwsSigningAlgorithm<JT>,
JT: JsonWebKeyType,
impl<AC, GC, JE, JS, JT> IdToken<AC, GC, JE, JS, JT>where
AC: AdditionalClaims,
GC: GenderClaim,
JE: JweContentEncryptionAlgorithm<JT>,
JS: JwsSigningAlgorithm<JT>,
JT: JsonWebKeyType,
sourcepub fn new<JU, K, S>(
claims: IdTokenClaims<AC, GC>,
signing_key: &S,
alg: JS,
access_token: Option<&AccessToken>,
code: Option<&AuthorizationCode>
) -> Result<Self, JsonWebTokenError>
pub fn new<JU, K, S>( claims: IdTokenClaims<AC, GC>, signing_key: &S, alg: JS, access_token: Option<&AccessToken>, code: Option<&AuthorizationCode> ) -> Result<Self, JsonWebTokenError>
Initializes an ID token with the specified claims, signed using the given signing key and algorithm.
If an access_token
and/or code
are provided, this method sets the at_hash
and/or
c_hash
claims using the given signing algorithm, respectively. Otherwise, those claims are
unchanged from the values specified in claims
.
sourcepub fn claims<'a, JU, K, N>(
&'a self,
verifier: &IdTokenVerifier<'_, JS, JT, JU, K>,
nonce_verifier: N
) -> Result<&'a IdTokenClaims<AC, GC>, ClaimsVerificationError>
pub fn claims<'a, JU, K, N>( &'a self, verifier: &IdTokenVerifier<'_, JS, JT, JU, K>, nonce_verifier: N ) -> Result<&'a IdTokenClaims<AC, GC>, ClaimsVerificationError>
Verifies and returns a reference to the ID token claims.
sourcepub fn into_claims<JU, K, N>(
self,
verifier: &IdTokenVerifier<'_, JS, JT, JU, K>,
nonce_verifier: N
) -> Result<IdTokenClaims<AC, GC>, ClaimsVerificationError>
pub fn into_claims<JU, K, N>( self, verifier: &IdTokenVerifier<'_, JS, JT, JU, K>, nonce_verifier: N ) -> Result<IdTokenClaims<AC, GC>, ClaimsVerificationError>
Verifies and returns the ID token claims.
sourcepub fn signing_alg(&self) -> Result<JS, SigningError>
pub fn signing_alg(&self) -> Result<JS, SigningError>
Returns the JwsSigningAlgorithm
used to sign this ID token.
This function returns an error if the token is unsigned or utilizes JSON Web Encryption (JWE).
Trait Implementations§
source§impl<AC: Clone + AdditionalClaims, GC: Clone + GenderClaim, JE: Clone + JweContentEncryptionAlgorithm<JT>, JS: Clone + JwsSigningAlgorithm<JT>, JT: Clone + JsonWebKeyType> Clone for IdToken<AC, GC, JE, JS, JT>
impl<AC: Clone + AdditionalClaims, GC: Clone + GenderClaim, JE: Clone + JweContentEncryptionAlgorithm<JT>, JS: Clone + JwsSigningAlgorithm<JT>, JT: Clone + JsonWebKeyType> Clone for IdToken<AC, GC, JE, JS, JT>
source§impl<AC: Debug + AdditionalClaims, GC: Debug + GenderClaim, JE: Debug + JweContentEncryptionAlgorithm<JT>, JS: Debug + JwsSigningAlgorithm<JT>, JT: Debug + JsonWebKeyType> Debug for IdToken<AC, GC, JE, JS, JT>
impl<AC: Debug + AdditionalClaims, GC: Debug + GenderClaim, JE: Debug + JweContentEncryptionAlgorithm<JT>, JS: Debug + JwsSigningAlgorithm<JT>, JT: Debug + JsonWebKeyType> Debug for IdToken<AC, GC, JE, JS, JT>
source§impl<'de, AC, GC: GenderClaim, JE: JweContentEncryptionAlgorithm<JT>, JS: JwsSigningAlgorithm<JT>, JT: JsonWebKeyType> Deserialize<'de> for IdToken<AC, GC, JE, JS, JT>where
AC: AdditionalClaims,
impl<'de, AC, GC: GenderClaim, JE: JweContentEncryptionAlgorithm<JT>, JS: JwsSigningAlgorithm<JT>, JT: JsonWebKeyType> Deserialize<'de> for IdToken<AC, GC, JE, JS, JT>where
AC: AdditionalClaims,
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
source§impl<AC, GC, JE, JS, JT> FromStr for IdToken<AC, GC, JE, JS, JT>where
AC: AdditionalClaims,
GC: GenderClaim,
JE: JweContentEncryptionAlgorithm<JT>,
JS: JwsSigningAlgorithm<JT>,
JT: JsonWebKeyType,
impl<AC, GC, JE, JS, JT> FromStr for IdToken<AC, GC, JE, JS, JT>where
AC: AdditionalClaims,
GC: GenderClaim,
JE: JweContentEncryptionAlgorithm<JT>,
JS: JwsSigningAlgorithm<JT>,
JT: JsonWebKeyType,
source§impl<AC: PartialEq + AdditionalClaims, GC: PartialEq + GenderClaim, JE: PartialEq + JweContentEncryptionAlgorithm<JT>, JS: PartialEq + JwsSigningAlgorithm<JT>, JT: PartialEq + JsonWebKeyType> PartialEq for IdToken<AC, GC, JE, JS, JT>
impl<AC: PartialEq + AdditionalClaims, GC: PartialEq + GenderClaim, JE: PartialEq + JweContentEncryptionAlgorithm<JT>, JS: PartialEq + JwsSigningAlgorithm<JT>, JT: PartialEq + JsonWebKeyType> PartialEq for IdToken<AC, GC, JE, JS, JT>
source§impl<AC, GC: GenderClaim, JE: JweContentEncryptionAlgorithm<JT>, JS: JwsSigningAlgorithm<JT>, JT: JsonWebKeyType> Serialize for IdToken<AC, GC, JE, JS, JT>where
AC: AdditionalClaims,
impl<AC, GC: GenderClaim, JE: JweContentEncryptionAlgorithm<JT>, JS: JwsSigningAlgorithm<JT>, JT: JsonWebKeyType> Serialize for IdToken<AC, GC, JE, JS, JT>where
AC: AdditionalClaims,
source§impl<AC, GC, JE, JS, JT> ToString for IdToken<AC, GC, JE, JS, JT>where
AC: AdditionalClaims,
GC: GenderClaim,
JE: JweContentEncryptionAlgorithm<JT>,
JS: JwsSigningAlgorithm<JT>,
JT: JsonWebKeyType,
impl<AC, GC, JE, JS, JT> ToString for IdToken<AC, GC, JE, JS, JT>where
AC: AdditionalClaims,
GC: GenderClaim,
JE: JweContentEncryptionAlgorithm<JT>,
JS: JwsSigningAlgorithm<JT>,
JT: JsonWebKeyType,
impl<AC: AdditionalClaims, GC: GenderClaim, JE: JweContentEncryptionAlgorithm<JT>, JS: JwsSigningAlgorithm<JT>, JT: JsonWebKeyType> StructuralPartialEq for IdToken<AC, GC, JE, JS, JT>
Auto Trait Implementations§
impl<AC, GC, JE, JS, JT> RefUnwindSafe for IdToken<AC, GC, JE, JS, JT>where
AC: RefUnwindSafe,
GC: RefUnwindSafe,
JE: RefUnwindSafe,
JS: RefUnwindSafe,
JT: RefUnwindSafe,
impl<AC, GC, JE, JS, JT> Send for IdToken<AC, GC, JE, JS, JT>
impl<AC, GC, JE, JS, JT> Sync for IdToken<AC, GC, JE, JS, JT>
impl<AC, GC, JE, JS, JT> Unpin for IdToken<AC, GC, JE, JS, JT>
impl<AC, GC, JE, JS, JT> UnwindSafe for IdToken<AC, GC, JE, JS, JT>
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