tuwunel_service/oauth/user_info.rs
1use serde::{Deserialize, Serialize};
2
3/// Selection of userinfo response claims.
4#[derive(Clone, Debug, Default, Deserialize, Serialize)]
5pub struct UserInfo {
6 /// Unique identifier number or login username. Usually a number on most
7 /// services. We consider a concatenation of the `iss` and `sub` to be a
8 /// universally unique identifier for some user/identity; we index that in
9 /// `oauthidpsub_oauthid`.
10 ///
11 /// Considered for user mxid only if none of the better fields are defined.
12 /// `login` alias intended for github.
13 #[serde(alias = "login")]
14 pub sub: String,
15
16 /// The login username we first consider when defined.
17 pub preferred_username: Option<String>,
18
19 /// The login username considered.
20 pub username: Option<String>,
21
22 /// The login username considered if none preferred.
23 pub nickname: Option<String>,
24
25 /// Full name.
26 pub name: Option<String>,
27
28 /// First name.
29 pub given_name: Option<String>,
30
31 /// Last name.
32 pub family_name: Option<String>,
33
34 /// Email address (`email` scope).
35 pub email: Option<String>,
36
37 /// URL to pfp (github/gitlab)
38 pub avatar_url: Option<String>,
39
40 /// URL to pfp (google)
41 pub picture: Option<String>,
42}