Skip to content

Chrome Browser OIDC Login Fails Due to Session oidc_state Loss #5929

@jacac

Description

@jacac

Describe the Bug

When logging in to BookStack using OpenID Connect (OIDC) in the Chrome browser, the login process fails and loops between BookStack and the OIDC provider. After a few loops the login succeeds.

Steps to Reproduce

  • Configure BookStack with OIDC authentication.
  • Open Bookstack.
  • Observe the session state in the session store (Redis in my case)
  • Click on the login button.
  • Observe the oidc_state in the session.
  • After a few seconds observer the oidc_state. It was missing for me.

Expected Behaviour

The OIDC login flow should complete successfully in Chrome without being interrupted by unrelated or failing resource requests. The oidc_state should be preserved until the authentication process is finalized.

Screenshots or Additional Context

The issue occurs because Chrome triggers additional requests (such as manifest.json, opensearch.xml, and even 404 requests like /dist/app.js.map (if DevTools are open) during the login flow. These requests interfere with the session handling of oidc_state. session()->flash() only preservers it for the next request.

session()->flash('oidc_state', $loginDetails['state']);
causing it to be removed before the login completes The subsequent check during the callback fails in
$this->showErrorNotification(trans('errors.oidc_fail_authed', ['system' => config('oidc.name')]));

Browser Details

Chrome Version 142.0.7444.176

Exact BookStack Version

v25.07.3

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions