Login by userId throws Invalid Username or password

HI there,


Login function from system


Throws an error:

"Invalid username or password"


What could be the cause of this ? 

It does this with users that are able to log-in using the username/password route

What is the use case that you are trying to use this function? Can you give more specifics? Including a screenshot of your logic?


Thanks,


Stacey

Tomas Kjartansson wrote:

HI there,


Login function from system


Throws an error:

"Invalid username or password"


What could be the cause of this ? 

It does this with users that are able to log-in using the username/password route

Please check the user id you passed is the same with the one using the username/password route. And also beware, the behavior of System-<Login with User->User_Login is different.


Stacey Levine wrote:

What is the use case that you are trying to use this function? Can you give more specifics? Including a screenshot of your logic?


Thanks,


Stacey

The usecase is when I'm not using Outsystems to validate the login but instead using third party tool. I've used it before where I validated the user through a similar tool, checked if a user already exists, if not I create and log the user in, If I find a user I log him in.

The users here don't have any password, instead the field is left blank so they wont be able to log in on their own somehow. This Login function has worked for me in the past but I'm not sure what is happening right here.


Solution

I managed to figure out what was causing this. This is a multi tenant application with some internal users being able to access data for multiple tenants. The cause of this error was the fact that I had the tenantId exposed in the users table in the application. So to fix this I simply changed that.


I don't know if this is suppose to behave like this or not but this is the fix for me at least :) 

Solution