User_login action causing error as "Invalid username or password" in mobile app

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. 

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

Hi Shweta,


Verify if the UserProvider of your modules is "Users"


Thanks !

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. 


Is your application MultiTenant ?

If yes then make sure your are Switching the Tenant

assif_tiger wrote:

Is your application MultiTenant ?

If yes then make sure your are Switching the Tenant

No..my application is not multi tenant. 


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


Pedro Costa wrote:

Hi Shweta,


Verify if the UserProvider of your modules is "Users"


Thanks !

Yes, the user provider is set to Users.


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 

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.



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.

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. 

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.

Hi, 

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

Cbeers