50
Views
13
Comments
Solved
Getting Login error after auto assigning role to the end user.
Application Type
Traditional Web

Hello all,
I am developing an e-commerce website.
I have created a customer role and have auto assigned this role when the user signs up. After signing up and registering when I log in with the newly registered user I get invalid username password error.
Can someone please help!

Thank you.

UserImage.jpg
Suriya Narayanan
Solution

Hi Wahaj Adil

Please try the 

GenerateSaltedMD5Hash() function to encrypt the password instead of the encryptpassword action

Thanks & Regards

2020-01-08 08-43-00
Rahul Kumar

Hi Suriya, 

EncryptPassword action also  use same GenerateSaltedSHA512Hash() function for encryption. Nothing wrong in EncryptPassowrd action. 

Wait, and try after some hours. Sometimes too many failed login attempts blocked the IP. 


Thanks

UserImage.jpg
Suriya Narayanan

Hi Rahul,

I don't have knowledge about how these two actions are working, but while using the GenerateSaltedSHA512Hash() function I can able log in without any error. This function is not taking any inputs too(username), and also while checking the user table I could see the salted password by GenerateSaltedSHA512Hash() and EncryptPassword looks different. Please clarify about this if you have any idea.

Thanks.

2020-01-08 08-43-00
Rahul Kumar

EncryptPassword action takes username and password as input because it Ensures different users with the same password have different password hashes in the database. 

2026-03-12 10-32-06
Wahaj Adil

I was able to get logged in using the GenerateSaltedSHA512Hash() action.

2021-06-02 20-50-04
Márcio Carvalho

Hello!!

I think is because you are not saving quite well the password for the User! It happened to me before! :)

You need to encrypt the password, using the username and the password. you have a function for that.

After using this encrypt function you are going to assign the encrypted p+assword to the password attribute of the User.

Let me know if I could help you

ps: I am giving you this solution based on my experience, where I already blocked myself because of not encrypting the password. Let me know if you are encrypting the password.

Kind regards,

Márcio

2026-03-12 10-32-06
Wahaj Adil

Hey!


I am encrypting the password still getting the invalid error msg.
Please have a look.

2021-06-02 20-50-04
Márcio Carvalho

Ok, I didn't know, thanks!

Can you share the OML to have a look? or let me know what you are doing to do the login, or how you are saving the new user? i need to see what is inside of the actions and assigns

2026-03-12 10-32-06
Wahaj Adil

Sure!

Have a look.
Please rectify the mistakes if any.
Thank you.

eShop.oml
2020-01-08 08-43-00
Rahul Kumar

Hi Wahaj, 

Have you checked to log in by username instead of email?  

In the email input box pass your username if email and username are different. 


Thanks



2026-03-12 10-32-06
Wahaj Adil

Yes, I have changed that property as well still the same error is being displayed.
Not able to log in with the new signed up user.

UserImage.jpg
Suriya Narayanan
Solution

Hi Wahaj Adil

Please try the 

GenerateSaltedMD5Hash() function to encrypt the password instead of the encryptpassword action

Thanks & Regards

2020-01-08 08-43-00
Rahul Kumar

Hi Suriya, 

EncryptPassword action also  use same GenerateSaltedSHA512Hash() function for encryption. Nothing wrong in EncryptPassowrd action. 

Wait, and try after some hours. Sometimes too many failed login attempts blocked the IP. 


Thanks

UserImage.jpg
Suriya Narayanan

Hi Rahul,

I don't have knowledge about how these two actions are working, but while using the GenerateSaltedSHA512Hash() function I can able log in without any error. This function is not taking any inputs too(username), and also while checking the user table I could see the salted password by GenerateSaltedSHA512Hash() and EncryptPassword looks different. Please clarify about this if you have any idea.

Thanks.

2020-01-08 08-43-00
Rahul Kumar

EncryptPassword action takes username and password as input because it Ensures different users with the same password have different password hashes in the database. 

2026-03-12 10-32-06
Wahaj Adil

I was able to get logged in using the GenerateSaltedSHA512Hash() action.

UserImage.jpg
Suriya Narayanan

Hi Wahaj,

I saw this condition on the default login action, based on this site property they are creating the hash with and without a username, this might be failing in your case. You can give it a try by changing the site property value as true if possible.

Thanks.

2026-03-12 10-32-06
Wahaj Adil

Sure , I'll have a look at this.

Thank you.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.