From f44ff91cd15f03df2c0274c838ae747d21d94c95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fl=C3=A1vio=20Correia=20Marta?= <7440579+CallMeFlanby@users.noreply.github.com> Date: Fri, 22 Sep 2023 17:44:24 +0200 Subject: [PATCH 1/2] [GenericInterface] 2FA was added --- Kernel/GenericInterface/Operation/Session/Common.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Kernel/GenericInterface/Operation/Session/Common.pm b/Kernel/GenericInterface/Operation/Session/Common.pm index 33e73420403..94634ec5a5f 100644 --- a/Kernel/GenericInterface/Operation/Session/Common.pm +++ b/Kernel/GenericInterface/Operation/Session/Common.pm @@ -46,9 +46,10 @@ sub CreateSessionID { my $User; my %UserData; my $UserType; - + # get params my $PostPw = $Param{Data}->{Password} || ''; + my $PostTwoFactorToken = $Param{Data}->{TwoFactorToken} || ''; if ( defined $Param{Data}->{UserLogin} && $Param{Data}->{UserLogin} ) { @@ -59,6 +60,7 @@ sub CreateSessionID { $User = $Kernel::OM->Get('Kernel::System::Auth')->Auth( User => $PostUser, Pw => $PostPw, + TwoFactorToken => $PostTwoFactorToken, ); %UserData = $Kernel::OM->Get('Kernel::System::User')->GetUserData( User => $User, @@ -75,6 +77,7 @@ sub CreateSessionID { $User = $Kernel::OM->Get('Kernel::System::CustomerAuth')->Auth( User => $PostUser, Pw => $PostPw, + TwoFactorToken => $PostTwoFactorToken, ); %UserData = $Kernel::OM->Get('Kernel::System::CustomerUser')->CustomerUserDataGet( User => $PostUser, From 7108c78849e2c73e740f9b713f9231ef0d0a3940 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fl=C3=A1vio=20Correia=20Marta?= <7440579+CallMeFlanby@users.noreply.github.com> Date: Mon, 16 Oct 2023 15:47:53 +0200 Subject: [PATCH 2/2] Added optional usage of HTTP header As recommended in the pull request --- Kernel/GenericInterface/Transport/HTTP/REST.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/Kernel/GenericInterface/Transport/HTTP/REST.pm b/Kernel/GenericInterface/Transport/HTTP/REST.pm index e2aef89435c..f1cc19eacab 100644 --- a/Kernel/GenericInterface/Transport/HTTP/REST.pm +++ b/Kernel/GenericInterface/Transport/HTTP/REST.pm @@ -229,6 +229,7 @@ sub ProviderProcessRequest { HTTP_X_OTRS_HEADER_SESSIONID => 'SessionID', HTTP_X_OTRS_HEADER_PASSWORD => 'Password', HTTP_X_OTRS_HEADER_IMPERSONATEASUSER => 'ImpersonateAsUser', + HTTP_X_OTRS_HEADER_TWOFACTORTOKEN => 'TwoFactorToken', ); HEADER: