Skip to content

[Bug]: An error occurred with the verification code when enabling Multi-Factor Authentication. #985

@wxtewx

Description

@wxtewx

Describe the problem

I want to enable Multi-Factor Authentication using the Microsoft Authenticator app. After scanning the QR code, I enter the verification code generated by Microsoft Authenticator, but the system prompts: Error: Invalid verification code. Please try again. I have checked the key displayed on the page, and it appears to be incorrect.

Steps to reproduce

  1. Click Set up app authentication
Image
  1. Scan the QR code and enter the verification code from Microsoft Authenticator
Image
  1. The system prompts: Error: Invalid verification code. Please try again.
Image
  1. It seems that the displayed key is incorrect.
Image

Poweradmin version

4.0.6

Database

MariaDB

Additional information (optional)

PHP Version: 8.4.16
Operating System: Debian 13.3
Web Server: Nginx
PowerDNS Version: 5.0.2

The error logs are as follows:
2026/02/02 15:50:51 [error] 1156#1156: *2 FastCGI sent in stderr: "PHP message: [MfaService] Generated QR code for user with email: admin@example.com; PHP message: [MfaSetupController] Generated QR code for user ID: 1" while reading response header from upstream, client: 192.168.100.3, server: dns.wxtewx.com, request: "POST /index.php?page=mfa_setup HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.4-fpm.sock:", host: "dns.wxtewx.com", referrer: "https://dns.wxtewx.com/index.php?page=mfa_setup"
2026/02/02 15:51:28 [error] 1155#1155: *12 FastCGI sent in stderr: "PHP message: [MfaService] Generated QR code for user with email: admin@example.com; PHP message: [MfaSetupController] Generated QR code for user ID: 1" while reading response header from upstream, client: 192.168.100.3, server: dns.wxtewx.com, request: "POST /index.php?page=mfa_setup HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.4-fpm.sock:", host: "dns.wxtewx.com", referrer: "https://dns.wxtewx.com/index.php?page=mfa_setup"
2026/02/02 16:03:23 [error] 1155#1155: *33 FastCGI sent in stderr: "PHP message: [MfaService] Generated QR code for user with email: admin@example.com; PHP message: [MfaSetupController] Generated QR code for user ID: 1" while reading response header from upstream, client: 192.168.100.3, server: dns.wxtewx.com, request: "POST /index.php?page=mfa_setup HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.4-fpm.sock:", host: "192.168.100.11", referrer: "https://192.168.100.11/index.php?page=mfa_setup"
2026/02/02 16:04:17 [error] 1155#1155: *26 FastCGI sent in stderr: "PHP message: [MfaService] Generated QR code for user with email: admin@example.com; PHP message: [MfaSetupController] Generated QR code for user ID: 1" while reading response header from upstream, client: 192.168.100.3, server: dns.wxtewx.com, request: "POST /index.php?page=mfa_setup HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.4-fpm.sock:", host: "192.168.100.11", referrer: "https://192.168.100.11/index.php?page=mfa_setup"
2026/02/02 16:04:28 [error] 1155#1155: *33 FastCGI sent in stderr: "PHP message: [MfaService] Verifying code for user ID: 1, type: email; PHP message: [MfaService] Email code expired for user ID: 1; PHP message: [MfaService] Generated QR code for user with email: admin@example.com; PHP message: [MfaSetupController] Generated QR code for user ID: 1" while reading response header from upstream, client: 192.168.100.3, server: dns.wxtewx.com, request: "POST /index.php?page=mfa_setup HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.4-fpm.sock:", host: "192.168.100.11", referrer: "https://192.168.100.11/index.php?page=mfa_setup"
2026/02/02 16:07:28 [error] 1155#1155: *44 FastCGI sent in stderr: "PHP message: [MfaService] Verifying code for user ID: 1, type: email; PHP message: [MfaService] Email code expired for user ID: 1; PHP message: [MfaService] Generated QR code for user with email: admin@example.com; PHP message: [MfaSetupController] Generated QR code for user ID: 1" while reading response header from upstream, client: 192.168.100.3, server: dns.wxtewx.com, request: "POST /index.php?page=mfa_setup HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.4-fpm.sock:", host: "192.168.100.11", referrer: "https://192.168.100.11/index.php?page=mfa_setup"
2026/02/02 16:07:44 [error] 1155#1155: *44 FastCGI sent in stderr: "PHP message: [MfaService] Verifying code for user ID: 1, type: email; PHP message: [MfaService] Email code expired for user ID: 1; PHP message: [MfaService] Generated QR code for user with email: admin@example.com; PHP message: [MfaSetupController] Generated QR code for user ID: 1" while reading response header from upstream, client: 192.168.100.3, server: dns.wxtewx.com, request: "POST /index.php?page=mfa_setup HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.4-fpm.sock:", host: "192.168.100.11", referrer: "https://192.168.100.11/index.php?page=mfa_setup"

Metadata

Metadata

Assignees

Labels

authAuthentication

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions