pub struct UserInfo {
pub sub: String,
pub email: Option<String>,
pub email_verified: bool,
pub name: Option<String>,
pub given_name: Option<String>,
pub family_name: Option<String>,
pub picture: Option<String>,
pub groups: Vec<String>,
pub provider: String,
}Expand description
User information extracted from tokens
Fields§
§sub: StringSubject (user ID from provider)
email: Option<String>email_verified: boolEmail verified
name: Option<String>Display name
given_name: Option<String>Given name
family_name: Option<String>Family name
picture: Option<String>Picture URL
groups: Vec<String>Groups
provider: StringProvider type
Implementations§
Source§impl UserInfo
impl UserInfo
Sourcepub fn from_claims(claims: &IdTokenClaims, provider: &str) -> Self
pub fn from_claims(claims: &IdTokenClaims, provider: &str) -> Self
Extract from ID token claims
Sourcepub fn email_domain(&self) -> Option<&str>
pub fn email_domain(&self) -> Option<&str>
Get email domain
Trait Implementations§
Source§impl<'de> Deserialize<'de> for UserInfo
impl<'de> Deserialize<'de> for UserInfo
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 UserInfo
impl RefUnwindSafe for UserInfo
impl Send for UserInfo
impl Sync for UserInfo
impl Unpin for UserInfo
impl UnwindSafe for UserInfo
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