mirror of
https://git.proxmox.com/git/proxmox-perl-rs
synced 2025-08-02 18:05:41 +00:00
fix #4234: openid: adjust openid verification function for userinfo option
Signed-off-by: Thomas Skinner <thomas@atskinner.net> [ML: rebased on master, added code to common and pve-rs forwarding] Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
This commit is contained in:
parent
b1f554dd11
commit
be287cfcf6
@ -54,9 +54,14 @@ pub mod export {
|
||||
#[try_from_ref] this: &OIDC,
|
||||
code: &str,
|
||||
private_auth_state: PrivateAuthState,
|
||||
query_userinfo: Option<bool>,
|
||||
) -> Result<Value, Error> {
|
||||
let oidc = this.inner.lock().unwrap();
|
||||
let claims = oidc.verify_authorization_code_simple(code, &private_auth_state)?;
|
||||
let claims = oidc.verify_authorization_code_simple_userinfo(
|
||||
code,
|
||||
&private_auth_state,
|
||||
query_userinfo.unwrap_or(true),
|
||||
)?;
|
||||
|
||||
Ok(to_value(&claims)?)
|
||||
}
|
||||
|
@ -41,7 +41,8 @@ mod export {
|
||||
#[try_from_ref] this: &OpenId,
|
||||
code: &str,
|
||||
private_auth_state: PrivateAuthState,
|
||||
query_userinfo: Option<bool>,
|
||||
) -> Result<Value, Error> {
|
||||
common::verify_authorization_code(this, code, private_auth_state)
|
||||
common::verify_authorization_code(this, code, private_auth_state, query_userinfo)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user