Login authentication problem in yii2

Hello,

I am having trouble in Authtenticating password for Yii2 in advance fronend. I get following error

"Incorrect username or password."

I know yii2 uses hash authentication. I am providing correct password that I remember from time of signup.

My Password field in database is always blank, there is nothing there, but there are bunch of characters in my password_hash and auth_key.

Is it normal for password field to be blank? or is this a bug in signup process?

1 Like

No, it’s not normal. I’ve checked fresh app install and it’s all fine to me. I’m able to register and the sign in with the password chosen.

You might need to re-install. Make sure you follow the steps carefully and run the migration. The reason that I say this is that you mentioned that your password field is empty, however, unless I am mistaken, there is no field named password in the advanced template. Anyway, you should follow the steps in the guide precisely. The data structure needs to be exact for it to work properly.

Hi,

Thank you for your reply.

I just reinstalled new Yii2 and signup there,but password filed is still empty,how I can login without password in Yii2 advanced template?

Why password not saving at the signup time? then why password filed on signup form.

Hi,

Thank you for your reply.

I just reinstalled new Yii2 and signup there,but password filed is still empty,how I can login without password in Yii2 advanced template?

The password gets saved in the password_hash field. When you set up the advanced template, you need to make sure run the init as per the instructions. then Create the database, and this is just creating a DB with no tables, configure your connection to the DB, then run the migration. The migration creates the user table for you. It follows an exact datastructure, which you must follow to get started.

The user signup process works complete out of the box, so if it does not work, most likely, you have not installed it correctly.

I am too getting the same error.I create up a user but am unable to login with the same credentials.

Faced the same problem. For advanced template default signup scenario - activate your account by email confirmation. Until that moment you user status is inactive. This status is used for login - only active users can log in.

If you don’t have email server and use this project for local purposes, you may change the status of your user in db from 9(inactive) to 10(active). Then your user will be found and you may log in with your password.

6 Likes

Thank you very much, i solved it.

Thank you so much :smiling_face_with_three_hearts:

thank you so much, it worked on my side.

Thanks i also had same problem , i solved now. can somebody tell , why this happens ?

Thank you so much, i solved it.

Good tip, resolved my issue