Can't login as admin
Added by ali rustam almost 14 years ago
I installed Redmine and successively logged in as admin using admin as password.
Then I changed admin paqssword and set up LDAP authentication. However after logging out I'm not able to login niether as admin with my new password nor as any ldap user. I've found 2 related posts on this forums stating in particular to use
RAILS_ENV=production script/runner 'user = User.find(:first, :conditions => {:admin => true}) ; user.password, user.password_confirmation = "my_password"; user.save!'
to change admin password to my_password but that didn't work for me. I allways get invalid user or password.
Thanks in advance.
Replies (6)
RE: Can't login as admin
-
Added by Felix Schäfer almost 14 years ago
Did you confirm the LDAP binding is configured correctly?
Anyway, I think the command should be:
RAILS_ENV=production script/runner 'user = User.find(:first, :conditions => {:admin => true}) ; user.password, user.password_confirmation = "my_password", "my_password"; user.save!'
(notice the repeated password string)
RE: Can't login as admin
-
Added by ali rustam almost 14 years ago
Thank you very much for your reply Felix. I solved the problem with admin account, that was my fault actually. But the LDAP still does not work. By pressing the test button on LDAP Authorization page I get "Successfull connection" and 0 in the users column. Account and password I entered work just right in phpldapadmin. And I entered "uid" in login field, following the way my LDAP directory configured (I saw sAMAccountName in several examples). When trying to login with any ldap account I get wrong user or password/
RE: Can't login as admin
-
Added by Felix Schäfer almost 14 years ago
The LDAP test only tests the connection, not if the account you have provided or the other settings yield any results. The number in the users column only shows how many redmine users are linked to LDAP, not how many LDAP users it could find.
The best way to troubleshoot this is to make sure your LDAP settings are correct, and to have a look at the logs on both sides to see who complains about what.
RE: Can't login as admin
-
Added by ali rustam almost 14 years ago
Well, it did work after I turned On-the-fly user creation = yes
Is that the way it should work? What for then do I have a choise of enabling it )?
As I guess it now takes ldap data and creates a user in mysql database, am I right? Though a lot of apps just take ldap data from directory and use it to authenticate. I do not want redmine to make any changes to ldap directory, so which approach would be better for me, if just reading ldap data to authenticate is possible of course?
Thanks in advance.
RE: Can't login as admin
-
Added by Felix Schäfer almost 14 years ago
Redmine currently only reads from and authenticates against the LDAP server, it won't write anything. You can make redmine authenticate against the LDAP server, all the other user attributes (firstname, lastname, email) remain in the redmine database.
The auto-create option works thusly: when on, if a user tries to login to redmine but there isn't a redmine user for that login yet, redmine will try to find a user in the LDAP with that login and prepopulate a redmine user with the information from LDAP (firstname, lastname, email). After that, redmine will never read anything again for that user and will only use LDAP to authenticate the user. When the auto-create option is off, redmine doesn't try to find users it doesn't know about in LDAP and you only have the option as administrator to create new users with authentication against LDAP, or to change the authentication from an already existing user to LDAP instead of the redmine mechanism.
RE: Can't login as admin
-
Added by ali rustam almost 14 years ago
Thanks a lot. Now it became clearer.