1110
Views
23
Comments
User_login action causing error as "Invalid username or password" in mobile app
Question

I am using User_login() action to login using particular credentials which is coming as username and password input parameter.

Input parameters are carrying appropriate data and even the entry has been created in system's user table successfully. But I'm getting error as "Invalid username or password "  whenever it passes through User_login() action. Please help on this. 

2021-04-09 11-42-43
assif_tiger
 
MVP

You might be passing the plain password directly to the User_Login().

1-call the EncrytpPassword() before & provide the plain password to this action, it will return you a SaltHash

2- Now give this SaltHask i.e Output of EncryptPassword Action as a Password to User_Login()


You can find EncryptPassword action in Users Module

2022-10-17 06-51-09
Shweta Gedam

assif_tiger wrote:

You might be passing the plain password directly to the User_Login().

1-call the EncrytpPassword() before & provide the plain password to this action, it will return you a SaltHash

2- Now give this SaltHask i.e Output of EncryptPassword Action as a Password to User_Login()


You can find EncryptPassword action in Users Module

Hello Assif, 

I have passed encrypted password already in password parameter. 


2022-07-12 16-41-57
Pedro Costa

Hi Shweta,


Verify if the UserProvider of your modules is "Users"


Thanks !

2022-10-17 06-51-09
Shweta Gedam

Pedro Costa wrote:

Hi Shweta,


Verify if the UserProvider of your modules is "Users"


Thanks !

Yes, the user provider is set to Users.


2021-04-09 11-42-43
assif_tiger
 
MVP

Is your application MultiTenant ?

If yes then make sure your are Switching the Tenant

2022-10-17 06-51-09
Shweta Gedam

assif_tiger wrote:

Is your application MultiTenant ?

If yes then make sure your are Switching the Tenant

No..my application is not multi tenant. 


2021-04-09 11-42-43
assif_tiger
 
MVP

Shweta Gedam wrote:

assif_tiger wrote:

Is your application MultiTenant ?

If yes then make sure your are Switching the Tenant

No..my application is not multi tenant. 


Can u Share the service center logs for the same,

also, check whether the user is blocked because of multiple invalid attempts


2020-02-28 09-46-54
Eduardo Jauch

User_Login

Action to login using username and password as credentials.

Inputs

Username
Type: mandatory, Text.
User's username
Password
Type: mandatory, Text.
User's password (should not be encrypted)
RememberLogin
Type: mandatory, Boolean.


So, if you are passing encripted password, that's the problem. 

Cheers 

2022-10-17 06-51-09
Shweta Gedam

Eduardo Jauch wrote:

User_Login

Action to login using username and password as credentials.

Inputs

Username
Type: mandatory, Text.
User's username
Password
Type: mandatory, Text.
User's password (should not be encrypted)
RememberLogin
Type: mandatory, Boolean.


So, if you are passing encripted password, that's the problem. 

Cheers 

I removed the encrypted password but still getting same error.



2023-03-01 13-44-24
Siddhant Chauhan

Hi,

either you have made changes in encryption(which encryption you are using) that makes error while comparing the password or you are comparing the password(text) with encrypted password.

I would suggest you to do a POC for the same, you can check the code in new app auto generated by OS for login.

Try to make new user after you change the code and then login with same.

2020-02-28 09-46-54
Eduardo Jauch

Hello Shweta, 

If the User Provider is right and you are passing username and pass not encripted to user login action, but still receives the invalid error message, probably you are trying to login with a user that does not exists or the password is just wrong. 

Go to the Users application, check your user to see if you are not passing the user name instead of username. 

Then, reset the password to something as simple as 123456 and try again. 

Just to rule out a mismatch in user or password. 

Cheers. 

2022-10-17 06-51-09
Shweta Gedam

Eduardo Jauch wrote:

Hello Shweta, 

If the User Provider is right and you are passing username and pass not encripted to user login action, but still receives the invalid error message, probably you are trying to login with a user that does not exists or the password is just wrong. 

Go to the Users application, check your user to see if you are not passing the user name instead of username. 

Then, reset the password to something as simple as 123456 and try again. 

Just to rule out a mismatch in user or password. 

Cheers. 


I'm doing registration of a new user(Sign up flow). And after the registration is completed user will be automatically login to the application with the provided username and password and it will redirected to the dashboard page.


I have checked the username and password, these are correct.

2020-02-28 09-46-54
Eduardo Jauch

Hi, 

Is it possible to share the module, or a version with the login flow, so that we can take a look? 

Cbeers

UserImage.jpg
周 芝敏

this problem have solution? i have getting the same problem. and i down't know how why.

some member cannot login system, after reset the password also cannot login.but some member are login succesully.

2020-02-28 09-46-54
Eduardo Jauch

Hi, 

Have you checked if those users are not blocked? 

Also, how are you creating the users. You may want to check if there are duplicated usernames in user entity, that could lead to login problems. 

Cheers 

2026-02-26 06-29-24
Rahul
 
MVP

Hi ,

Can you let us know where are you creating password for user  from "Users"(https://<domain>/Users) application or you have create form for user create,

if you are creating a form for user registraion than should check when insert password in db it should be encrypt

like below image-


Hope this will help you.

Regards

Rahul Sahu

2024-06-19 07-19-32
JitendraYadav

Hi,

Please share sample OML.


Thanks

UserImage.jpg
Aaron Mukerjee

Getting the same error


UserImage.jpg
Aaron Mukerjee

I had not added the users dependency , once i got that added the issue was resolved

UserImage.jpg
Aaron Mukerjee

Hey Shweta, got to Module>Manage dependencies, and search for Users dependency, it might have gotten deleted.

2025-05-05 10-10-34
Vednarayan

Hi Shweta

I have to get the same problem, but when I applied EncrytpPassword, Problem was resolved

You might be passing the plain password directly that's why you got an error,

You need to call the EncrytpPassword before. And then try to log in.

Please let me know if it works for you.

Regards

Vednarayan 


UserImage.jpg
Sharayu Shendre

Hi!
I have applied the encrypted password. Still, the issue persists.

2024-09-13 15-32-30
Mohammad Mz

I'm unfortunately experiencing same problem. 

I have tried to implement a reset password functionality, unfortunately when the password has been reset, I can't use the new password to login. 


When reseting the password I'm using System EncryptPassword, and I can confirm that the encrypted password is stored in the system User table. 

When perform the login I pass the password from the input field to the system server action: User_Login (I'm not using the former EncryptPassword since I presume the User_Login function will be doing it). 

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