feat(openid): add picture url in id_token claims
This commit is contained in:
parent
283c4ebad2
commit
77104472df
1 changed files with 6 additions and 0 deletions
|
|
@ -77,7 +77,12 @@ struct OIDCIdTokenClaims {
|
|||
/// additional claims
|
||||
name: Option<String>,
|
||||
email: Option<String>,
|
||||
/// handle of user
|
||||
preferred_username: Option<String>,
|
||||
/// Public URL to the user asset id (for now)
|
||||
/// In the future, we should create a unique link per authorization
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
picture: Option<String>,
|
||||
roles: Vec<String>,
|
||||
nonce: Option<String>
|
||||
}
|
||||
|
|
@ -97,6 +102,7 @@ impl OIDCIdTokenClaims {
|
|||
exp: get_current_timestamp() + 86_000,
|
||||
email: user.email,
|
||||
name: user.full_name,
|
||||
picture: user.avatar_asset_id.map(|asset_id| format!("{}/api/user-assets/{}", &config.instance.base_uri, asset_id)),
|
||||
preferred_username: Some(user.handle),
|
||||
roles: user.roles.0,
|
||||
nonce
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue