[Bug Report]: OIDC token failures fail to notify upon errors #2652

Closed
opened 2026-02-05 04:43:03 +03:00 by OVERLORD · 0 comments
Owner

Originally created by @ssddanbrown on GitHub (Feb 14, 2022).

Describe the Bug

Errors during ID token validation fail to notify back to the user.
This is due to an extra redirect in the path

  • GET /oidc/callback
  • GET /
    • Not authed, Redired to /login
    • Flashed session lost
  • GET /login

Steps to Reproduce

Setup OIDC with:

OIDC_ISSUER_DISCOVER=false
OIDC_PUBLIC_KEY=https://example.com

Expected Behaviour

"ID token validate failed with error: Failed to read signing key with error: Unexpected type of key value provided" message should display to user.

Exact BookStack Version

v21.12.5

PHP Version

No response

Hosting Environment

Dev


  • Could do with cleaning up OpenIdConnectException usage while at it. Probably keep to normal exception then convert at controller level.
  • Ensure case added to tests.
Originally created by @ssddanbrown on GitHub (Feb 14, 2022). ### Describe the Bug Errors during ID token validation fail to notify back to the user. This is due to an extra redirect in the path - GET `/oidc/callback` - [Exception](https://github.com/BookStackApp/BookStack/blob/6e325de226fd930dae481a13ba80e002c6214a74/app/Auth/Access/Oidc/OidcService.php#L185), Sets error then redirects to `/` - GET `/` - Not authed, Redired to `/login` - Flashed session lost - GET `/login` ### Steps to Reproduce Setup OIDC with: ```bash OIDC_ISSUER_DISCOVER=false OIDC_PUBLIC_KEY=https://example.com ``` ### Expected Behaviour "ID token validate failed with error: Failed to read signing key with error: Unexpected type of key value provided" message should display to user. ### Exact BookStack Version v21.12.5 ### PHP Version _No response_ ### Hosting Environment Dev --- - [x] Could do with cleaning up `OpenIdConnectException` usage while at it. Probably keep to normal exception then convert at controller level. - [x] Ensure case added to tests.
OVERLORD added the 🐛 Bug label 2026-02-05 04:43:03 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#2652