mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
Better 2fa verification support (#6782)
* Better 2fa verification support Signed-off-by: fufesou <shuanglongchen@yeah.net> * 2FA login verification, add request filed 'tfa_code' Signed-off-by: fufesou <shuanglongchen@yeah.net> * 2fa dialog Signed-off-by: fufesou <shuanglongchen@yeah.net> * msgbox, title Signed-off-by: fufesou <shuanglongchen@yeah.net> * Feat, oidc login, 2fa Signed-off-by: fufesou <shuanglongchen@yeah.net> --------- Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
@@ -95,6 +95,8 @@ pub struct UserPayload {
|
||||
pub struct AuthBody {
|
||||
pub access_token: String,
|
||||
pub r#type: String,
|
||||
#[serde(default)]
|
||||
pub tfa_type: String,
|
||||
pub user: UserPayload,
|
||||
}
|
||||
|
||||
@@ -238,15 +240,17 @@ impl OidcSession {
|
||||
while OIDC_SESSION.read().unwrap().keep_querying && begin.elapsed() < query_timeout {
|
||||
match Self::query(&api_server, &code_url.code, &id, &uuid) {
|
||||
Ok(HbbHttpResponse::<_>::Data(auth_body)) => {
|
||||
if remember_me {
|
||||
LocalConfig::set_option(
|
||||
"access_token".to_owned(),
|
||||
auth_body.access_token.clone(),
|
||||
);
|
||||
LocalConfig::set_option(
|
||||
"user_info".to_owned(),
|
||||
serde_json::json!({ "name": auth_body.user.name, "status": auth_body.user.status }).to_string(),
|
||||
);
|
||||
if auth_body.r#type == "access_token" {
|
||||
if remember_me {
|
||||
LocalConfig::set_option(
|
||||
"access_token".to_owned(),
|
||||
auth_body.access_token.clone(),
|
||||
);
|
||||
LocalConfig::set_option(
|
||||
"user_info".to_owned(),
|
||||
serde_json::json!({ "name": auth_body.user.name, "status": auth_body.user.status }).to_string(),
|
||||
);
|
||||
}
|
||||
}
|
||||
OIDC_SESSION
|
||||
.write()
|
||||
|
||||
Reference in New Issue
Block a user