Skip to content

'AuthenticatorValidateStage' object has no attribute 'friendly_name' #10106

@archont94

Description

@archont94

Describe the bug
Seems like AuthenticatorValidateStage does not inherit friendly_name attribute from parent class or it doesn't implement it itself, which causes error during login stage.

As a workaround I mapped /authentik directory to local copy of it and I modified this line from "name": stage.friendly_name or stage.name, to "name": stage.name,.

To Reproduce
Steps to reproduce the behavior:

  1. Go to Stages
  2. Edit default-authentication-mfa-validation
  3. Set Not configured action to Force the user to configure an authenticator
  4. Set Configuration stages to default-authentication-login + default-authentication-mfa-validation + default-source-enrollment-login
  5. During next login attempt you will get error message as attached below.

Expected behavior
MFA configuration should be enforced or MFA code verified, then user should be logged in after providing valid MFA code.

Screenshots
image

Logs

"message": "Traceback (most recent call last):
  File "/authentik/flows/views/executor.py", line 290, in get
    stage_response = self.current_stage_view.dispatch(request)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/ak-root/venv/lib/python3.12/site-packages/django/views/generic/base.py", line 143, in dispatch
    return handler(request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/authentik/stages/authenticator_validate/stage.py", line 273, in get
    return self.prepare_stages(user)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/authentik/stages/authenticator_validate/stage.py", line 301, in prepare_stages
    return super().get(self.request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/authentik/flows/stage.py", line 95, in get
    challenge = self._get_challenge(*args, **kwargs)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/authentik/flows/stage.py", line 172, in _get_challenge
    challenge = self.get_challenge(*args, **kwargs)

       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/authentik/stages/authenticator_validate/stage.py", line 328, in get_challenge
    "name": stage.friendly_name or stage.name,
            ^^^^^^^^^^^^^^^^^^^
builtins.AttributeError: 'AuthenticatorValidateStage' object has no attribute 'friendly_name'"}

Version and Deployment (please complete the following information):

  • authentik version: 2024.4.2
  • Deployment: docker-compose

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions