Skip to content

[6.x] Add config for disabling Elevated Sessions#14464

Open
1stevengrant wants to merge 5 commits intostatamic:6.xfrom
1stevengrant:disable-elevated-session
Open

[6.x] Add config for disabling Elevated Sessions#14464
1stevengrant wants to merge 5 commits intostatamic:6.xfrom
1stevengrant:disable-elevated-session

Conversation

@1stevengrant
Copy link
Copy Markdown
Contributor

Summary

  • Adds an elevated_session_disabled config option to config/users.php that allows disabling elevated sessions entirely
  • When disabled, the RequireElevatedSession middleware is bypassed, so users are never prompted to reauthorize
  • Includes tests validating the disabled behavior

Context

Our Statamic implementation uses Auth0 as the primary auth driver, which means elevated sessions (password re-confirmation) are not applicable since authentication is handled externally. This config option allows us (and others using OAuth providers) to cleanly disable the feature.

References:

@1stevengrant 1stevengrant changed the title Add config for disabling Elevated Sessions [6.x] Add config for disabling Elevated Sessions Apr 9, 2026
Copy link
Copy Markdown
Member

@jasonvarga jasonvarga left a comment

Choose a reason for hiding this comment

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

Opting out of a security feature like this feels awkward.

How are you implementing OAuth on your site? It might make sense if the Elevated Session page allowed you to re-authenticate however you authenticated in the first place.

That might be a big rabbit hole though. It'll probably end up better to just allow a way to disable it in the end, but I'd still like to know.

In any case, could you change it to elevated_sessions_enabled (with true as the default) as having disabled: true always feels backwards.

@1stevengrant
Copy link
Copy Markdown
Contributor Author

We use Auth0 to authenticate via OTP.

There's a customised login screen hosted with them and then we have a success callback that handles Laravel auth.

We never login via the control panel.

Works fine currently with v5.

@jasonvarga
Copy link
Copy Markdown
Member

Fair enough. Yeah let's just flip the config to be _enabled rather than _disabled then.

@1stevengrant 1stevengrant requested a review from jasonvarga April 10, 2026 01:30
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.

3 participants