You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the roles field in the response of the OIDC system is a empty array and user try to login without exist user in bookstack, they will get this error:
Steps to Reproduce
Return a empty groups claims in OIDC user response
Try to login without exist user in bookstack
Throw error
Expected Behaviour
User login success and create a new bookstack account with a default role if the groups claims is empty (it should can be config by editing .env or web ui?).
An empty (but valid formed) groups list provided via the OIDC ID token
would be considered as a lacking detail, and therefore trigger a lookup
to the userinfo endpoint in an attempt to get that information.
This fixes this to properly distinguish between not-provided and empty
state, to avoid userinfo where provided as valid but empty.
Includes test to cover.
For #5101
Thanks for reporting @Misaka-L.
I could confirm that BookStack was not differentiating between non-provided and an empty groups list in the OIDC ID token data, and therefore would default to calling the userinfo endpoint upon an empty group list in an attempt to gain more information.
I'm not sure why the userinfo call was failing for you though, I did double check this against a live OIDC system to ensure the userinfo part works as expected, which it does from my test.
Otherwise, I've addressed the providing of empty groups in commit 767699a, so the userinfo won't be called if a valid empty group list is provided, and this will be part of the next patch release.
Describe the Bug
If the
roles
field in the response of the OIDC system is a empty array and user try to login without exist user in bookstack, they will get this error:Steps to Reproduce
Expected Behaviour
User login success and create a new bookstack account with a default role if the groups claims is empty (it should can be config by editing
.env
or web ui?).Screenshots or Additional Context
OIDC User info dump
.env
Browser Details
Microsoft Edge 127.0.2651.15 Beta (64-bit) on Windows 11 24H2 (26120.961)
Exact BookStack Version
v24.05.2
The text was updated successfully, but these errors were encountered: