pub struct IdToken<T = ()> { /* private fields */ }
Expand description
OpenID connect ID Token.
More detail, see OpenID Connect Core specification
If you need additionan non-standard claims, make your own struct and specify it to authenticate().
ⓘ
#[derive(serde::Deserialize)]
struct IdTokenExtraClaims {
picture: Option<String>,
}
let id_token_with_picture = oidc_client
.authenticate::<IdTokenExtraClaims>(&state, &code, &session)?;
let picture_url = id_token_with_picture.extra().picture;
Implementations§
Source§impl<T> IdToken<T>
impl<T> IdToken<T>
Sourcepub fn subject(&self) -> &str
pub fn subject(&self) -> &str
Subject Identifier. A locally unique and never reassigned identifier within the Issuer for the End-User.
Trait Implementations§
Source§impl<'de, T> Deserialize<'de> for IdToken<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for IdToken<T>where
T: Deserialize<'de>,
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<T> Freeze for IdToken<T>where
T: Freeze,
impl<T> RefUnwindSafe for IdToken<T>where
T: RefUnwindSafe,
impl<T> Send for IdToken<T>where
T: Send,
impl<T> Sync for IdToken<T>where
T: Sync,
impl<T> Unpin for IdToken<T>where
T: Unpin,
impl<T> UnwindSafe for IdToken<T>where
T: UnwindSafe,
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