GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — changing mfa_supported_methods breaks the application · Issue #6624 · pgadmin-org/pgadmin4

changing mfa_supported_methods breaks the application #6624

New issue
Copy link
New issue
Copy link
Closed
Closed
changing mfa_supported_methods breaks the application#6624
Copy link
Assignees
yogeshmahajan-1903
Labels
Bug
Milestone
7.6

Description

@roussidis
roussidis
opened on Jul 27, 2023
Issue body actions

In pgadmin v7.5 when running in server mode and have the option MFA_SUPPORTED_METHODS = ["authenticator"] ( Default is MFA_SUPPORTED_METHODS = ["email", "authenticator"]) the site breaks when the 2FA is enabled and can't login.

Dump log

2023-07-27 12:53:14,574: ERROR  pgadmin:  'mfa.send_email_code'
Traceback (most recent call last):
  File "/usr/pgadmin4/venv/lib/python3.10/site-packages/flask/app.py", line 1823, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/pgadmin4/venv/lib/python3.10/site-packages/flask/app.py", line 1799, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
  File "/usr/pgadmin4/venv/lib/python3.10/site-packages/flask_login/utils.py", line 290, in decorated_view
    return current_app.ensure_sync(func)(*args, **kwargs)
  File "/usr/pgadmin4/web/pgadmin/authenticate/mfa/views.py", line 137, in validate_view
    return Response(render_template(
  File "/usr/pgadmin4/venv/lib/python3.10/site-packages/flask/templating.py", line 147, in render_template
    return _render(app, template, context)
  File "/usr/pgadmin4/venv/lib/python3.10/site-packages/flask/templating.py", line 130, in _render
    rv = template.render(context)
  File "/usr/pgadmin4/venv/lib/python3.10/site-packages/jinja2/environment.py", line 1301, in render
    self.environment.handle_exception()
  File "/usr/pgadmin4/venv/lib/python3.10/site-packages/jinja2/environment.py", line 936, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "/usr/pgadmin4/web/pgadmin/authenticate/mfa/templates/mfa/validate.html", line 2, in top-level template code
    {% set page_props = {
  File "/usr/pgadmin4/venv/lib/python3.10/site-packages/flask/app.py", line 2020, in url_for
    self.inject_url_defaults(endpoint, values)
  File "/usr/pgadmin4/venv/lib/python3.10/site-packages/flask/app.py", line 2257, in inject_url_defaults
    func(endpoint, values)
  File "/usr/pgadmin4/web/pgadmin/__init__.py", line 883, in add_internal_version
    urls = [url for url in app.url_map.iter_rules(endpoint)]
  File "/usr/pgadmin4/venv/lib/python3.10/site-packages/werkzeug/routing/map.py", line 164, in iter_rules
    return iter(self._rules_by_endpoint[endpoint])
KeyError: 'mfa.send_email_code'

When the option MFA_SUPPORTED_METHODS is reverted to its default one (["mail", "authenticator"]) then everything works as expected

To Reproduce

Steps to reproduce the behavior:

  1. Create a config_local.py or a config_system.py file with the option MFA_SUPPORTED_METHODS = ["authenticator"] and 2FA enabled
  2. Start the server
  3. Access pgadmin web interface and login.

Expected behavior

Expected behavior would be to be redirected to the Authenticator dialog box which will ask for the OTP

Desktop (please complete the following information):

  • OS: Debian 11 and Ubuntu 22 (has been reproduced in both systems)
  • Version: 7.5
  • Mode: Server
  • Browser tested on chrome but will break on any
  • Package type: deb

Activity

  1. roussidis
    added
    Bug
    on Jul 27, 2023
  2. akshay-joshi
    added this to Not Refinedon Jul 27, 2023
  3. adityatoshniwal
    self-assigned this
    on Jul 27, 2023
  4. adityatoshniwal
    added this to Current Sprint (213) and removed this from Not Refinedon Jul 27, 2023
  5. adityatoshniwal
    moved this to 🆕 New in Current Sprint (213)on Jul 27, 2023
  6. adityatoshniwal
    moved this from 🆕 New to 🏗 In Progress in Current Sprint (213)on Jul 31, 2023
  7. adityatoshniwal
    added a commit that references this issue on Jul 31, 2023

    Fix an issue where changing MFA_SUPPORTED_METHODS breaks the MFA vali…

    2aea5b4
  8. adityatoshniwal
    moved this from 🏗 In Progress to In Testing in Current Sprint (213)on Jul 31, 2023
  9. adityatoshniwal
    added this to the 7.6 milestone on Jul 31, 2023
  10. akshay-joshi
    added
    EDB Sprint 147
    on Jul 31, 2023
  11. akshay-joshi
    unassigned
    adityatoshniwal
    on Jul 31, 2023
  12. akshay-joshi
    added
    EDB Sprint 148
    and removed
    EDB Sprint 147
    on Aug 2, 2023
  13. akshay-joshi
    added a commit that references this issue on Aug 4, 2023

    Fix an issue where changing MFA_SUPPORTED_METHODS breaks the MFA vali…

    69085c4
  14. yogeshmahajan-1903
    self-assigned this
    on Aug 10, 2023
  15. yogeshmahajan-1903 commented on Aug 11, 2023

    @yogeshmahajan-1903
    yogeshmahajan-1903
    on Aug 11, 2023
    Contributor
    More actions

    This is working fine.

  16. yogeshmahajan-1903
    closed this as completedon Aug 11, 2023
  17. yogeshmahajan-1903
    moved this from In Testing to ✅ Done in Current Sprint (213)on Aug 11, 2023
  18. akshay-joshi
    removed this from Current Sprint (213)on Aug 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @yogeshmahajan-1903
    yogeshmahajan-1903

Labels

Bug

Type

No type

Projects

No projects

    Milestone

    • 7.6

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.