Skip to content

MFA TOTP Authenticator - "Failed to validate the code" #9783

@R-P-H

Description

@R-P-H

When registering for MFA using TOTP code, it gives error "Failed to validate the code".

To Reproduce

Steps to reproduce the behavior:

  1. sudo apt install pgadmin4-web
  2. Create config_local.py to force MFA via TOTP.
########################################################################
# Two-factor Authentication Configuration
########################################################################

# Set it to True, to enable the two-factor authentication
MFA_ENABLED = True

# Set it to True, to ask the users to register forcefully for the
# two-authentication methods on logged-in.
MFA_FORCE_REGISTRATION = True

# pgAdmin supports Two-factor authentication by either sending an one-time code
# to an email, or using the TOTP based application like Google Authenticator.
MFA_SUPPORTED_METHODS = ["authenticator"]
########################################################################
  1. Login via pgadmin4 web & scan TOTP QR code in Google authenticator.
  2. Enter TOTP code from authenticator.
  3. Get error message "Failed to validate the code".
  • OS: Ubuntu 22.04.5 LTS, Linux-6.8.0-106-generic-x86_64-with-glibc2.35
  • pgAdmin version: 9.13
  • Mode: Server
  • Browser (if running in server mode): Chrome 146.0.0.0
  • Package type: DEB
  • Python version: 3.10.12

I am accessing /pgadmin4 web via an insecure IP address.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions