From abf0e84fc3284a7b56b6f0ca06dd996355cbd5f9 Mon Sep 17 00:00:00 2001 From: liuyuanpeng <867491149@qq.com> Date: Thu, 18 Jan 2024 10:52:32 +0800 Subject: [PATCH] fix(single login): single login MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Description:单点登录迁移到后端 Log: 无 --- uniauth-backend/src/serviceinterface.cpp | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/uniauth-backend/src/serviceinterface.cpp b/uniauth-backend/src/serviceinterface.cpp index 58670dd..8c11eaf 100644 --- a/uniauth-backend/src/serviceinterface.cpp +++ b/uniauth-backend/src/serviceinterface.cpp @@ -41,7 +41,7 @@ #include #define UKUI_GREETER "/usr/sbin/ukui-greeter" -#define UKUI_SCREENSAVER "/usr/bin/ukui-screensaver-dialog" +#define UKUI_SCREENSAVER "/usr/bin/ukui-screensaver-backend" #define GREETER_DBUS_PATH "/" #define GREETER_DBUS_INTERFACE "org.ukui.greeter" @@ -916,13 +916,13 @@ bool ServiceInterface::sendPassword(QString username,QByteArray password) rsac.decrypt(password, decryptText, priKey); // 解密 //如果处于登录状态 - qDebug()<<"sendPassword"<0){ + qDebug()<<"login by screensaver:"; + isFirstLogin = false; + QString publicKey = getLoginPubKey(loginAppList.value(loginAppList.firstKey()),SCREENSAVER_DBUS_PATH,SCREENSAVER_DBUS_INTERFACE); + rsac.encrypt(decryptText, encryptText, publicKey.toLatin1()); + return sendLoginPassword(loginAppList.value(loginAppList.firstKey()),SCREENSAVER_DBUS_PATH,SCREENSAVER_DBUS_INTERFACE,username,encryptText); + } + //如果是第一次调用,则配置自动登录 if(isFirstLogin){ qDebug()<<"isFirstLogin:"; @@ -965,13 +973,13 @@ bool ServiceInterface::handleFirstSingleLogn(QString username,QByteArray decrypt qDebug()< stateReply = iface.call("sendPassword",username,array); if(!stateReply.isValid()){ disconnect(connection);