OJS 3 Can't Login

Hi @ctgraham,

This recently came up in the forum, leading to issue #1821. IIRC usernames were silently converted to lower case upon registration, but it may be that the login code for OJS 3.0 no longer does this, which is why it’s been encountered recently.

I tend to think of usernames like I think of code, which is probably not typical – would you expect them to be simply case insensitive? Or to force a lower-case only requirement on them? Or…

Regards,
Alec Smecher
Public Knowledge Project Team

Nope, no caps in my admin’s username. It does have a “-” in the middle. Would that make any difference?

Hi @Oneill381,

Would you mind testing to see whether a username without the dash permits you to login? Off the top of my head that should be OK, but if it proves to cause a difference, I can investigate further.

Regards,
Alec Smecher
Public Knowledge Project Team

Because I strongly support/encourage the option of emails as usernames, I believe that usernames should be case insensitive. This matches most of my personal login experiences, with the exception of one banking institution which requires case-sensitive and mixed char/numeric usernames.

Didn’t seem to make any difference, still can’t login

I have the same issue. The technical support team from where I buy hosting for installing OJS 3 does not recommend installing OJS 3 since it is still unstable (Is it right?). But, I ask their help to install it in my spanel. They did and gave me username and password. I cannot use them to login.

Hi @Oneill381 and @kawahyu,

One way to help debug this would be to manually set the password hash in the database. Try executing…

UPDATE users SET password=SHA1(CONCAT(username,'newPasswordHere')) WHERE username='usernameHere';

OJS supports a few ways of hashing passwords; this will use the older SHA1 hashing method. When you first log in after resetting the password this way, OJS will automatically upgrade the hash to a newer method.

If you’re able to log in exactly once after resetting the password this way, it’ll help identify the problem as the system’s support for the more modern hashing method.

Regards,
Alec Smecher
Public Knowledge Project Team

Thanks. Finally, I can login

Greetings,

When I was installing OJS3 on my own server all was ok. But when I had installed it on share hosting there was the problem with login. Unexpectedly my coworker couldn`t login with my credentials from another computer. And there was no errors shown. I have tried to change password from admin menu and from database and it did not work. From my PC all was OK.

From my point of view the OJS3 is stable but need some fairly easy updates for production use. And I think it is much better to deploy it on own server. Hosting companies are often take money for nothing :slight_smile:

Hi all,

Can someone confirm whether the password reset process above results in an account that will work across several login/logout cycles, or whether it only works once?

Regards,
Alec Smecher
Public Knowledge Project Team

I just ran it, and I was able to login, then it prompted me to update my password. I updated my password via the web interface, tried to login again, and no such luck

Hi @Oneill381,

What is the length of the password column in the users table in your database?

Regards,
Alec Smecher
Public Knowledge Project Team

The column itself allows up to 225. For the user in question, right now it’s at 0

Hi @Oneill381,

The password column is empty for that user? Can you confirm? Very interesting!

Regards,
Alec Smecher
Public Knowledge Project Team

Yup, confirmed, it’s empty there. Just has a 0 in the column

Hi all,

What version of PHP are you using?

Regards,
Alec Smecher
Public Knowledge Project Team

It looks like we’re using 5.3.3

The hosting tech team reset the password for me since I have no idea on
“UPDATE users SET password=SHA1(CONCAT(username,‘newPasswordHere’)) WHERE username=‘usernameHere’;”
I can login until now as admin. However, a new issue comes up. I just try to register with different email. I login but it does not work. It says invalid username or password. How i can solve this?

big hope for a solution on login problem so that I can start using ojs 3 for my journal.

Hi all,

It seems as though the password_compat library, which OJS uses to ensure that the PHP environment supports the password hashing tools OJS needs, is returning 0 for password hashes. This library might log a number of error messages (e.g. Crypt must be loaded for password_hash to function). Can you check to see whether anything like this is logged?

If you’re able, can you try using the same installation in a different hosting/development environment to help establish whether this is related to your platform?

I believe OJS 2.4.x had the same requirements for password hashing, and indeed uses the same code, and we haven’t had reports of this problem arising with OJS 2.4.x – have any of you tried that on the same hosting platform to see whether it behaves the same?

Regards,
Alec Smecher
Public Knowledge Project Team