A user with the email ... already exists but with different credentials #3940

Closed
opened 2026-02-05 07:54:48 +03:00 by OVERLORD · 6 comments
Owner

Originally created by @antwacky on GitHub (Jul 27, 2023).

Attempted Debugging

  • I have read the debugging page

Searched GitHub Issues

  • I have searched GitHub for the issue.

Describe the Scenario

I've found some similar issues but not quite the same.

Previously we used Microsoft Azure authentication to authenticate users. We are now moving to Keycloak, using OIDC login.

When I change the authentication method from Azure to OIDC and login, I get the error:

"A user with the email ... already exists but with different credentials"

I've seen other issues that mention updating the external ID, but I can see no such option. I can see 'Disconnect account'.

We have lots of users so the ideal solution will not involve editing via the UI.

Thanks in advance!

Exact BookStack Version

23.06.2

Log Content

A user with the email ... already exists but with different credentials

PHP Version

8.2.8

Hosting Environment

Docker image ghcr.io/linuxserver/bookstack:23.06.2 on Kubernetes.

Originally created by @antwacky on GitHub (Jul 27, 2023). ### Attempted Debugging - [X] I have read the debugging page ### Searched GitHub Issues - [X] I have searched GitHub for the issue. ### Describe the Scenario I've found some similar issues but not quite the same. Previously we used Microsoft Azure authentication to authenticate users. We are now moving to Keycloak, using OIDC login. When I change the authentication method from Azure to OIDC and login, I get the error: "A user with the email ... already exists but with different credentials" I've seen other issues that mention updating the external ID, but I can see no such option. I can see 'Disconnect account'. We have lots of users so the ideal solution will not involve editing via the UI. Thanks in advance! ### Exact BookStack Version 23.06.2 ### Log Content A user with the email ... already exists but with different credentials ### PHP Version 8.2.8 ### Hosting Environment Docker image ghcr.io/linuxserver/bookstack:23.06.2 on Kubernetes.
OVERLORD added the 🐕 Support label 2026-02-05 07:54:48 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Jul 27, 2023):

Hi @antwacky,

Please see my video linked below, particular the "External authentication ID field" part of the video starting at 9:16.

https://youtu.be/TJQ4NJrMvkw?t=556

@ssddanbrown commented on GitHub (Jul 27, 2023): Hi @antwacky, Please see my video linked below, particular the "External authentication ID field" part of the video starting at 9:16. https://youtu.be/TJQ4NJrMvkw?t=556
Author
Owner

@antwacky commented on GitHub (Jul 27, 2023):

Hi, thanks for this. When I select external_auth_id from the database the field is empty for all users (current auth method is Azure OIDC).

So I should prepopulate the external_auth_id field using the Keycloak ID for each user then switch Bookstack to OIDC method?

@antwacky commented on GitHub (Jul 27, 2023): Hi, thanks for this. When I select external_auth_id from the database the field is empty for all users (current auth method is Azure OIDC). So I should prepopulate the external_auth_id field using the Keycloak ID for each user then switch Bookstack to OIDC method?
Author
Owner

@ssddanbrown commented on GitHub (Jul 27, 2023):

So I should prepopulate the external_auth_id field using the Keycloak ID for each user then switch Bookstack to OIDC method?

Assuming that the Keycloak ID is the ID property being used (for the ID token sub claim unless you're changing it with the BookStack OIDC_EXTERNAL_ID_CLAIM option) then yes.
Could just test it with one account first to make sure you're using the right ID property.

@ssddanbrown commented on GitHub (Jul 27, 2023): > So I should prepopulate the external_auth_id field using the Keycloak ID for each user then switch Bookstack to OIDC method? Assuming that the Keycloak ID is the ID property being used (for the ID token `sub` claim unless you're changing it with the BookStack `OIDC_EXTERNAL_ID_CLAIM` option) then yes. Could just test it with one account first to make sure you're using the right ID property.
Author
Owner

@antwacky commented on GitHub (Jul 27, 2023):

Great thanks, maybe I'll set the claim to be the email so I don't have to cross reference each user when updating.

Another quick question, the Azure method has the options:

AZURE_AUTO_REGISTER: "true"
AZURE_AUTO_CONFIRM_EMAIL: "true"

I couldn't see similar options for OIDC.

@antwacky commented on GitHub (Jul 27, 2023): Great thanks, maybe I'll set the claim to be the email so I don't have to cross reference each user when updating. Another quick question, the Azure method has the options: AZURE_AUTO_REGISTER: "true" AZURE_AUTO_CONFIRM_EMAIL: "true" I couldn't see similar options for OIDC.
Author
Owner

@ssddanbrown commented on GitHub (Jul 27, 2023):

AZURE_AUTO_REGISTER

When OIDC is active, there is no separate register page, auto-register is essentially active by default.

AZURE_AUTO_CONFIRM_EMAIL

Again, this is usually redundant if using OIDC, you'd generally look to trust the incoming users from your identity platform, so you wouldn't use the domain restriction/email confirmation options.

@ssddanbrown commented on GitHub (Jul 27, 2023): > AZURE_AUTO_REGISTER When OIDC is active, there is no separate register page, auto-register is essentially active by default. > AZURE_AUTO_CONFIRM_EMAIL Again, this is usually redundant if using OIDC, you'd generally look to trust the incoming users from your identity platform, so you wouldn't use the domain restriction/email confirmation options.
Author
Owner

@antwacky commented on GitHub (Jul 27, 2023):

Awesome thanks, closing the issue. Will reopen if I come across issues on the next attempt at moving to OIDC.

@antwacky commented on GitHub (Jul 27, 2023): Awesome thanks, closing the issue. Will reopen if I come across issues on the next attempt at moving to OIDC.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#3940