This topic is locked
[SOLVED]

Two factor authentication problem

5/9/2024 6:30:51 AM
PHPRunner General questions
B
bluestrikealpha author

Hi,

I am having problem wih the two factor authentication by email. I set the email to send the code, but when I make the login display the following information:

img alt
.
Can you help me with this?

Thank you

Sergey Kornilov admin 5/9/2024

I recommend checking this article, it should point you in the right direction:

https://asprunner.com/forums/topic/29214-Troubleshooting-SMTP-errors

B
bluestrikealpha author 5/14/2024

Hi,

I already read the documentation of the li nk that you send me, but when I made the debug the information that appear is this:
"SELECT FROM pdf_formoptions
SELECT
FROM exred19_ugrights WHERE ( ( ( GroupID IN ( -3 ) ) and ( NOT ( AccessMask is null or AccessMask = '' ) ) ) )
SELECT Cell phone, Company phone, email, ID, Name, Password, phone, phone1, User name, two_factor, reset_token, reset_date, Permissions, Companyname, Company adres, Company city, Company Country, Company ID, Department, userpic FROM User of database WHERE ( ( ( upper(User name) = upper('PSousa') ) ) ) limit 0, 1
SELECT * FROM exred19_ugrights WHERE ( ( ( GroupID IN ( -3 ) ) and ( NOT ( AccessMask is null or AccessMask = '' ) ) ) )"

For what I can understand it should work.

Can someone help me?

Thank you

Sergey Kornilov admin 5/15/2024

As a first step you need to make sure that imple email can be sent. This "Error sending message" is coming from somewhere. Maybe you need to start by sending a simple email to make sure that it is working. The article that I sent you should help you with email troubleshooting.

If a simple email can be sent but email-based 2FA is still not working, you need to contact support directly.

B
bluestrikealpha author 5/23/2024

Hi,

I made some test and also change my email to the google stmp service and know if I upload my project to my server I receive the following error code:

SELECT Cell phone, Company phone, email, ID, Name, Password, phone, phone1, User name, two_factor, reset_token, reset_date, Permissions, Companyname, Company adres, Company city, Company Country, Company ID, Department, userpic, totp FROM User of database WHERE ( ( User name='PSousa' ) ) ORDER BY 4 ASC limit 0, 1
{"status":"error","message":"Error sending message. "}

But if I upload the project to the demo account, the email is sent with the code but I still can't login on the site since the site give the following error:

ELECT Cell phone, Company phone, email, ID, Name, Password, phone, phone1, User name, two_factor, reset_token, reset_date, Permissions, Companyname, Company adres, Company city, Company Country, Company ID, Department, userpic, totp FROM User of database WHERE ( ( User name='PSousa' ) ) ORDER BY 4 ASC limit 0, 1
2024-05-23 09:48:24 Connection: opening to ssl://smtp.gmail.com:465, timeout=300, options=array ()
2024-05-23 09:48:24 Connection: opened
2024-05-23 09:48:24 SMTP -> get_lines(): $data is ""
2024-05-23 09:48:24 SMTP -> get_lines(): $str is "220 smtp.gmail.com ESMTP ada2fe7eead31-488ef13ac35sm802102137.13 - gsmtp"
2024-05-23 09:48:24 SERVER -> CLIENT: 220 smtp.gmail.com ESMTP ada2fe7eead31-488ef13ac35sm802102137.13 - gsmtp
2024-05-23 09:48:24 CLIENT -> SERVER: EHLO demo.asprunner.net
2024-05-23 09:48:24 SMTP -> get_lines(): $data is ""
2024-05-23 09:48:24 SMTP -> get_lines(): $str is "250-smtp.gmail.com at your service, [23.111.145.114]"
2024-05-23 09:48:24 SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [23.111.145.114]"
2024-05-23 09:48:24 SMTP -> get_lines(): $str is "250-SIZE 35882577"
2024-05-23 09:48:24 SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [23.111.145.114]250-SIZE 35882577"
2024-05-23 09:48:24 SMTP -> get_lines(): $str is "250-8BITMIME"
2024-05-23 09:48:24 SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [23.111.145.114]250-SIZE 35882577250-8BITMIME"
2024-05-23 09:48:24 SMTP -> get_lines(): $str is "250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH"
2024-05-23 09:48:24 SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [23.111.145.114]250-SIZE 35882577250-8BITMIME250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH"
2024-05-23 09:48:24 SMTP -> get_lines(): $str is "250-ENHANCEDSTATUSCODES"
2024-05-23 09:48:24 SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [23.111.145.114]250-SIZE 35882577250-8BITMIME250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH250-ENHANCEDSTATUSCODES"
2024-05-23 09:48:24 SMTP -> get_lines(): $str is "250-PIPELINING"
2024-05-23 09:48:24 SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [23.111.145.114]250-SIZE 35882577250-8BITMIME250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH250-ENHANCEDSTATUSCODES250-PIPELINING"
2024-05-23 09:48:24 SMTP -> get_lines(): $str is "250-CHUNKING"
2024-05-23 09:48:24 SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [23.111.145.114]250-SIZE 35882577250-8BITMIME250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH250-ENHANCEDSTATUSCODES250-PIPELINING250-CHUNKING"
2024-05-23 09:48:24 SMTP -> get_lines(): $str is "250 SMTPUTF8"
2024-05-23 09:48:24 SERVER -> CLIENT: 250-smtp.gmail.com at your service, [23.111.145.114]250-SIZE 35882577250-8BITMIME250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH250-ENHANCEDSTATUSCODES250-PIPELINING250-CHUNKING250 SMTPUTF8
2024-05-23 09:48:24 Auth method requested: UNKNOWN
2024-05-23 09:48:24 Auth methods available on the server: LOGIN,PLAIN,XOAUTH2,PLAIN-CLIENTTOKEN,OAUTHBEARER,XOAUTH
2024-05-23 09:48:24 Auth method selected: LOGIN
2024-05-23 09:48:24 CLIENT -> SERVER: AUTH LOGIN
2024-05-23 09:48:24 SMTP -> get_lines(): $data is ""
2024-05-23 09:48:24 SMTP -> get_lines(): $str is "334 VXNlcm5hbWU6"
2024-05-23 09:48:24 SERVER -> CLIENT: 334 VXNlcm5hbWU6
2024-05-23 09:48:24 CLIENT -> SERVER: d2VibWFzdGVyZXhyZWRldUBnbWFpbC5jb20=
2024-05-23 09:48:24 SMTP -> get_lines(): $data is ""
2024-05-23 09:48:24 SMTP -> get_lines(): $str is "334 UGFzc3dvcmQ6"
2024-05-23 09:48:24 SERVER -> CLIENT: 334 UGFzc3dvcmQ6
2024-05-23 09:48:24 CLIENT -> SERVER: cnBvZSBjd2N6IGxqcHUgcWp3Yw==
2024-05-23 09:48:24 SMTP -> get_lines(): $data is ""
2024-05-23 09:48:24 SMTP -> get_lines(): $str is "235 2.7.0 Accepted"
2024-05-23 09:48:24 SERVER -> CLIENT: 235 2.7.0 Accepted
2024-05-23 09:48:24 CLIENT -> SERVER: MAIL FROM:<webmasterexredeu@gmail.com>
2024-05-23 09:48:24 SMTP -> get_lines(): $data is ""
2024-05-23 09:48:24 SMTP -> get_lines(): $str is "250 2.1.0 OK ada2fe7eead31-488ef13ac35sm802102137.13 - gsmtp"
2024-05-23 09:48:24 SERVER -> CLIENT: 250 2.1.0 OK ada2fe7eead31-488ef13ac35sm802102137.13 - gsmtp
2024-05-23 09:48:24 CLIENT -> SERVER: RCPT TO:<test@test.com>
2024-05-23 09:48:24 SMTP -> get_lines(): $data is ""
2024-05-23 09:48:24 SMTP -> get_lines(): $str is "250 2.1.5 OK ada2fe7eead31-488ef13ac35sm802102137.13 - gsmtp"
2024-05-23 09:48:24 SERVER -> CLIENT: 250 2.1.5 OK ada2fe7eead31-488ef13ac35sm802102137.13 - gsmtp
2024-05-23 09:48:24 CLIENT -> SERVER: DATA
2024-05-23 09:48:25 SMTP -> get_lines(): $data is ""
2024-05-23 09:48:25 SMTP -> get_lines(): $str is "354 Go ahead ada2fe7eead31-488ef13ac35sm802102137.13 - gsmtp"
2024-05-23 09:48:25 SERVER -> CLIENT: 354 Go ahead ada2fe7eead31-488ef13ac35sm802102137.13 - gsmtp
2024-05-23 09:48:25 CLIENT -> SERVER: Date: Thu, 23 May 2024 05:48:24 -0400
2024-05-23 09:48:25 CLIENT -> SERVER: To: test@test.com
2024-05-23 09:48:25 CLIENT -> SERVER: From: webmasterexredeu@gmail.com
2024-05-23 09:48:25 CLIENT -> SERVER: Subject: Verification code
2024-05-23 09:48:25 CLIENT -> SERVER: Message-ID: <1b7dbbe5dc4898681a24c25f049a8548@demo.asprunner.net>
2024-05-23 09:48:25 CLIENT -> SERVER: X-Mailer: PHPMailer 5.2.27 (https://github.com/PHPMailer/PHPMailer)
2024-05-23 09:48:25 CLIENT -> SERVER: MIME-Version: 1.0
2024-05-23 09:48:25 CLIENT -> SERVER: Content-Type: text/plain; charset=utf-8
2024-05-23 09:48:25 CLIENT -> SERVER:
2024-05-23 09:48:25 CLIENT -> SERVER:
2024-05-23 09:48:25 CLIENT -> SERVER: Your verification code for https://demo.asprunner.net/p_sousa_sophisticati_com/EXRED247_v1_06_testes_Pedro/ is:
2024-05-23 09:48:25 CLIENT -> SERVER: 226627
2024-05-23 09:48:25 CLIENT -> SERVER:
2024-05-23 09:48:25 CLIENT -> SERVER: .
2024-05-23 09:48:25 SMTP -> get_lines(): $data is ""
2024-05-23 09:48:25 SMTP -> get_lines(): $str is "250 2.0.0 OK 1716457705 ada2fe7eead31-488ef13ac35sm802102137.13 - gsmtp"
2024-05-23 09:48:25 SERVER -> CLIENT: 250 2.0.0 OK 1716457705 ada2fe7eead31-488ef13ac35sm802102137.13 - gsmtp
2024-05-23 09:48:25 CLIENT -> SERVER: QUIT
2024-05-23 09:48:25 SMTP -> get_lines(): $data is ""
2024-05-23 09:48:25 SMTP -> get_lines(): $str is "221 2.0.0 closing connection ada2fe7eead31-488ef13ac35sm802102137.13 - gsmtp"
2024-05-23 09:48:25 SERVER -> CLIENT: 221 2.0.0 closing connection ada2fe7eead31-488ef13ac35sm802102137.13 - gsmtp
2024-05-23 09:48:25 Connection: closed
{"status":"confirm","method":"0","email":"test@test.com"}

B
bluestrikealpha author 6/3/2024

Hi,
I already can send the email with the code for the two factor authentication also on my own server, but after I send the code appear the following error:

img alt

And for what I can see on "see details" all works as should be.

Someone knows how to solve that?

Thank you

Sergey Kornilov admin 6/3/2024

It looks like you need to turn the debug info off.

B
bluestrikealpha author 6/3/2024

Thank for your help it's solved