Skip to content

stages/user_login: require next action flows before login - #24846

Open
dominic-r wants to merge 5 commits into
dominic/next-actions/plan-splicefrom
dominic/next-actions/enforce
Open

stages/user_login: require next action flows before login#24846
dominic-r wants to merge 5 commits into
dominic/next-actions/plan-splicefrom
dominic/next-actions/enforce

Conversation

@dominic-r

@dominic-r dominic-r commented Aug 6, 2026

Copy link
Copy Markdown
Member

Users with the goauthentik.io/user/next-actions attribute (a flow slug or list of slugs) are routed through those flows before the user login stage creates their session, and each flow is removed from the attribute once completed. Requires a valid enterprise license (silently skipped otherwise), is skipped during user switching, and fails closed when an action doesn't resolve to a usable flow. The user API rejects values that don't resolve to a flow or that use an authentication/invalidation flow, so blueprints and API writes are validated up front.

This is the generalized take on #23577 per review feedback there: the action is a flow rather than a hardcoded password flag, and the original login plan resumes after the actions instead of being discarded.

Closes #19681

@dominic-r
dominic-r requested a review from a team as a code owner August 6, 2026 18:49
@dominic-r dominic-r self-assigned this Aug 6, 2026
@dominic-r dominic-r added this to the Release 2026.11.0: Required milestone Aug 6, 2026
@netlify

netlify Bot commented Aug 6, 2026

Copy link
Copy Markdown

Deploy Preview for authentik-integrations ready!

Name Link
🔨 Latest commit d5ed345
🔍 Latest deploy log https://app.netlify.com/projects/authentik-integrations/deploys/6a78b6181beb3400081c6ce5
😎 Deploy Preview https://deploy-preview-24846--authentik-integrations.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Aug 6, 2026

Copy link
Copy Markdown

Deploy Preview for authentik-docs ready!

Name Link
🔨 Latest commit d5ed345
🔍 Latest deploy log https://app.netlify.com/projects/authentik-docs/deploys/6a78b618ede77f000881f104
😎 Deploy Preview https://deploy-preview-24846--authentik-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copilot AI lite review requested due to automatic review settings August 6, 2026 19:38
@dominic-r
dominic-r requested a review from a team as a code owner August 6, 2026 19:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@dominic-r
dominic-r force-pushed the dominic/next-actions/enforce branch from f5975c1 to 4447fbd Compare August 6, 2026 19:49
Copilot AI review requested due to automatic review settings August 6, 2026 20:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings August 6, 2026 20:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings August 7, 2026 14:49
@dominic-r
dominic-r force-pushed the dominic/next-actions/enforce branch from 17e1f32 to caedd92 Compare August 7, 2026 14:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

try:
resolve_next_actions(attributes[USER_ATTRIBUTE_NEXT_ACTIONS])
except ValueError as exc:
raise ValidationError(str(exc)) from exc
@codecov

codecov Bot commented Aug 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.17012% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.38%. Comparing base (39a2fe7) to head (d5ed345).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
authentik/core/api/users.py 96.87% 1 Missing ⚠️
authentik/stages/user_login/stage.py 98.38% 1 Missing ⚠️
Additional details and impacted files
@@                         Coverage Diff                          @@
##           dominic/next-actions/plan-splice   #24846      +/-   ##
====================================================================
+ Coverage                             91.41%   94.38%   +2.97%     
====================================================================
  Files                                  1145     1109      -36     
  Lines                                 71789    68150    -3639     
  Branches                               3875        0    -3875     
====================================================================
- Hits                                  65625    64325    -1300     
+ Misses                                 6129     3825    -2304     
+ Partials                                 35        0      -35     
Flag Coverage Δ
conformance 34.78% <12.86%> (-0.08%) ⬇️
e2e 39.47% <12.86%> (-0.10%) ⬇️
integration 30.88% <9.54%> (-0.54%) ⬇️
rust ?
unit 93.09% <99.17%> (+0.02%) ⬆️
unit-migrate 93.11% <99.17%> (+0.02%) ⬆️

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

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

@dominic-r
dominic-r force-pushed the dominic/next-actions/enforce branch from caedd92 to 6110a14 Compare August 9, 2026 17:13
Users with the goauthentik.io/user/next-actions attribute set are routed
through the listed flows before the login stage creates their session, and
each flow is removed from the attribute once completed. Requires a valid
enterprise license, skipped during user switching, fails closed when an
action doesn't resolve to a usable flow. The user API rejects values that
don't resolve to flows or use an authentication/invalidation flow.

Closes: #19681
Setting, removing, and completing a next action now create
next_action_set/next_action_removed/next_action_completed events instead
of only generic model updates, and the attribute save at login no longer
creates a model update event.
@dominic-r
dominic-r force-pushed the dominic/next-actions/enforce branch from 6110a14 to b0cf6c6 Compare August 9, 2026 17:14
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@dominic-r dominic-r linked an issue Aug 9, 2026 that may be closed by this pull request
@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown
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-d5ed345a5a9702c402330c1741a6b59e6ad18629
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-d5ed345a5a9702c402330c1741a6b59e6ad18629

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

Force password reset on next login Forcing users into next actions

3 participants