Cant log into admin account / temp admin accounts #1461

Closed
opened 2026-02-05 00:58:36 +03:00 by OVERLORD · 3 comments
Owner

Originally created by @ITman2019 on GitHub (Nov 25, 2019).

Describe the bug
A clear and concise description of what the bug is.
Can't log into bookstack using admin account. I tried to add additional admin accounts using the php artisan command. It accepted the new users but on trying to login it says invalid credentials
Steps To Reproduce
Steps to reproduce the behavior:

  1. Go to 'login'

  2. See error

     if (!$user->exists) {
         // Check for users with same email already
         $alreadyUser = $user->newQuery()->where('email', '=', $user->email)->count() > 0;
         if ($alreadyUser) {
             throw new AuthException(trans('errors.error_user_exists_different_creds', ['email' => $user->email]));
         }
    

Expected behavior
login account

Your Configuration (please complete the following information):

  • Exact BookStack Version (Found in settings):
  • PHP Version:
  • Hosting Method (Nginx/Apache/Docker): Apache

Additional context
LDAP / AD authentication

Originally created by @ITman2019 on GitHub (Nov 25, 2019). **Describe the bug** A clear and concise description of what the bug is. Can't log into bookstack using admin account. I tried to add additional admin accounts using the php artisan command. It accepted the new users but on trying to login it says invalid credentials **Steps To Reproduce** Steps to reproduce the behavior: 1. Go to 'login' 4. See error if (!$user->exists) { // Check for users with same email already $alreadyUser = $user->newQuery()->where('email', '=', $user->email)->count() > 0; if ($alreadyUser) { throw new AuthException(trans('errors.error_user_exists_different_creds', ['email' => $user->email])); } **Expected behavior** login account **Your Configuration (please complete the following information):** - Exact BookStack Version (Found in settings): - PHP Version: - Hosting Method (Nginx/Apache/Docker): Apache **Additional context** LDAP / AD authentication
Author
Owner

@ssddanbrown commented on GitHub (Nov 25, 2019):

Hi @ITman2019,
This will generally occur if BookStack finds a matching user if the LDAP system but there is already a BookStack user using the same email address, where that existing user does not have an ID that matches with the LDAP system.

I think, Upon LDAP user first login, BookStack will store the uid attribute, or the DN as a backup if uid does not exist` and then it'll use that value later to link users.

The admin artisan command will create admin users but you'll need to change the auth method back to standard, at least for a short while, to login otherwise BookStack will query the LDAP system.

@ssddanbrown commented on GitHub (Nov 25, 2019): Hi @ITman2019, This will generally occur if BookStack finds a matching user if the LDAP system but there is already a BookStack user using the same email address, where that existing user does not have an ID that matches with the LDAP system. I think, Upon LDAP user first login, BookStack will store the `uid` attribute, or the DN as a backup if `uid` does not exist` and then it'll use that value later to link users. The admin artisan command will create admin users but you'll need to change the auth method back to `standard`, at least for a short while, to login otherwise BookStack will query the LDAP system.
Author
Owner

@ITman2019 commented on GitHub (Nov 25, 2019):

ah that makes sense, how do i change the login method then if i cant get

On Mon, Nov 25, 2019 at 3:21 PM Dan Brown notifications@github.com wrote:

Hi @ITman2019 https://github.com/ITman2019,
This will generally occur if BookStack finds a matching user if the LDAP
system but there is already a BookStack user using the same email address,
where that existing user does not have an ID that matches with the LDAP
system.

I think, Upon LDAP user first login, BookStack will store the uid
attribute, or the DN as a backup if uid does not exist` and then it'll
use that value later to link users.

The admin artisan command will create admin users but you'll need to
change the auth method back to standard, at least for a short while, to
login otherwise BookStack will query the LDAP system.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/BookStackApp/BookStack/issues/1799?email_source=notifications&email_token=ANYA6EXYC7IGNZZI3J5L2SDQVPNPBA5CNFSM4JRIBTWKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFCRWBI#issuecomment-558177029,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ANYA6EXO6V2MZJ7ENUIHOD3QVPNPBANCNFSM4JRIBTWA
.

@ITman2019 commented on GitHub (Nov 25, 2019): ah that makes sense, how do i change the login method then if i cant get On Mon, Nov 25, 2019 at 3:21 PM Dan Brown <notifications@github.com> wrote: > Hi @ITman2019 <https://github.com/ITman2019>, > This will generally occur if BookStack finds a matching user if the LDAP > system but there is already a BookStack user using the same email address, > where that existing user does not have an ID that matches with the LDAP > system. > > I think, Upon LDAP user first login, BookStack will store the uid > attribute, or the DN as a backup if uid does not exist` and then it'll > use that value later to link users. > > The admin artisan command will create admin users but you'll need to > change the auth method back to standard, at least for a short while, to > login otherwise BookStack will query the LDAP system. > > — > You are receiving this because you were mentioned. > Reply to this email directly, view it on GitHub > <https://github.com/BookStackApp/BookStack/issues/1799?email_source=notifications&email_token=ANYA6EXYC7IGNZZI3J5L2SDQVPNPBA5CNFSM4JRIBTWKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFCRWBI#issuecomment-558177029>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/ANYA6EXO6V2MZJ7ENUIHOD3QVPNPBANCNFSM4JRIBTWA> > . >
Author
Owner

@ITman2019 commented on GitHub (Nov 25, 2019):

fixed. thanks!

@ITman2019 commented on GitHub (Nov 25, 2019): fixed. thanks!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#1461