Skip to content

stages/authenticator_webauthn: add option to configure max attempts #15041

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 22, 2025

Conversation

BeryJu
Copy link
Member

@BeryJu BeryJu commented Jun 13, 2025

Details

Some cleanup and add the option to limit the max webauthn registration attempts


Checklist

  • Local tests pass (ak test authentik/)
  • The code has been formatted (make lint-fix)

If an API change has been made

  • The API schema has been updated (make gen-build)

If changes to the frontend have been made

  • The code has been formatted (make web)

If applicable

  • The documentation has been updated
  • The documentation has been formatted (make website)

BeryJu added 4 commits June 14, 2025 00:31
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
@BeryJu BeryJu requested review from a team as code owners June 13, 2025 23:10
Copy link

netlify bot commented Jun 13, 2025

Deploy Preview for authentik-storybook canceled.

Name Link
🔨 Latest commit 74320c4
🔍 Latest deploy log https://app.netlify.com/projects/authentik-storybook/deploys/684cb49178eec900085042f5

Copy link

netlify bot commented Jun 13, 2025

Deploy Preview for authentik-docs canceled.

Name Link
🔨 Latest commit 74320c4
🔍 Latest deploy log https://app.netlify.com/projects/authentik-docs/deploys/684cb4925ea3c100080ddc0b

Copy link

codecov bot commented Jun 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.83%. Comparing base (2aceed2) to head (74320c4).
Report is 94 commits behind head on main.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #15041      +/-   ##
==========================================
+ Coverage   92.77%   92.83%   +0.05%     
==========================================
  Files         815      815              
  Lines       42117    42156      +39     
==========================================
+ Hits        39073    39134      +61     
+ Misses       3044     3022      -22     
Flag Coverage Δ
e2e 47.63% <18.82%> (-0.01%) ⬇️
integration 24.34% <9.41%> (-0.02%) ⬇️
unit 90.67% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
@BeryJu BeryJu force-pushed the stages/authenticator_webauthn/max-attempts branch from 06b1c2d to 74320c4 Compare June 13, 2025 23:30
Copy link
Contributor

authentik PR Installation instructions

Instructions for docker-compose

Add the following block to your .env file:

AUTHENTIK_IMAGE=ghcr.io/goauthentik/dev-server
AUTHENTIK_TAG=gh-74320c45953633c9af587066612bc8b144713fe3
AUTHENTIK_OUTPOSTS__CONTAINER_IMAGE_BASE=ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s

Afterwards, run the upgrade commands from the latest release notes.

Instructions for Kubernetes

Add the following block to your values.yml file:

authentik:
    outposts:
        container_image_base: ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s
global:
    image:
        repository: ghcr.io/goauthentik/dev-server
        tag: gh-74320c45953633c9af587066612bc8b144713fe3

Afterwards, run the upgrade commands from the latest release notes.

Copy link
Collaborator

@gergosimonyi gergosimonyi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from webauthn registration currently being broken by #14460

screenshot

and EmptyState currently being broken by #14289 (resulting in no error being shown)

screenshot

this seems good 😄

from authentik.stages.authenticator_webauthn.utils import get_origin, get_rp_id

LOGGER = get_logger()
if TYPE_CHECKING:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not to lower the morale but can authentik switch to a real language please? :)))

@@ -84,6 +84,8 @@ class AuthenticatorWebAuthnStage(ConfigurableStage, FriendlyNamedStage, Stage):

device_type_restrictions = models.ManyToManyField("WebAuthnDeviceType", blank=True)

max_attempts = models.PositiveIntegerField(default=0)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

null=True instead of treating 0 as Infinity?

(Then this can be a real _Positive_IntegerField)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would do that but the API schema then turns it into number | undefined | null which is annoying to deal with in the UI

@BeryJu BeryJu merged commit 53d8f9b into main Jun 22, 2025
101 checks passed
@BeryJu BeryJu deleted the stages/authenticator_webauthn/max-attempts branch June 22, 2025 23:49
cavefire pushed a commit to cavefire/authentik that referenced this pull request Jun 24, 2025
…oauthentik#15041)

* house keeping - migrate to session part 1

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

* cleanup v2

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

* add max_attempts

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

* teeny tiny cleanup

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

* add ui

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

---------

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants