I have a weird issue. 

In our factory, when creating new users they are set to inactive. We also set users with last_login greater than 90 days to inactive.

All of my applications make use of an "extended" login action. This action will check if the user is valid and then set the user.is_Active = true, before then using the OutSystems "User_Login" action. Passing username, password and remember login state. 

Login from Login Screen on End User Application


Extended Login Action

This seems to work fine, however on debugging and it reaches the User_Login action, it will display "An error from the application: Invalid username or password"

I have made sure that the username and password are correct and the user is still logged in and the error does not show up on the error log. 

However if I intentionally get the password wrong. the same debugging steps will display the "An error from the application: Invalid usernam or password" 3 times and will not log in the user, this shows up on the error log. 

The applications are not multi tennant.

I am wondering what is causing this error to appear, and if it would be safe to ignore it, considering it doesnt show up on in the error log, or stops the user logging in?

Hi Chistopher,


We developed something similar on our web app and we do as follow:

1 - Get User by username (we use an SQL because aggregate only return active users)
2 - Update User.IsActive = True and commit the transaction
3 - Call User_Login action

This works fine and dont return that  error message.


Hello Luis,

Thanks for getting in touch. 

I have just tried to put the "CommitTransaction" before the User_Login but unfortunately the error is still displaying in debug. However it does not prevent the user logging in. Their account is set to active as we would expect and if the debugger is not on there is no effect to the user experience. 

Thank you again for sharing your use case. it has helped me simplify mine too. 

Christopher Kennedy wrote:

Hello Luis,

Thanks for getting in touch. 

I have just tried to put the "CommitTransaction" before the User_Login but unfortunately the error is still displaying in debug. However it does not prevent the user logging in. Their account is set to active as we would expect and if the debugger is not on there is no effect to the user experience. 

Thank you again for sharing your use case. it has helped me simplify mine too. 

Hi,

Can you send the print where you got that error message? I can replicate it on my side

Hello Luis,

The action has changed a little but this shows where the debugger is when the error is displayed.

Christopher Kennedy wrote:

Hello Luis,

The action has changed a little but this shows where the debugger is when the error is displayed.

Hi,

Are you using users from AD or LDAP?

I opened the action User_Login (on clone module) and try to find why returnthat message. I also checked that action is logging the error in Service center. Can you check there if you can see more details abou the error?



Luis, 

I really appreciate all the effort you are going through to troubleshoot this. 

We have LDAP Authentication configured in the Users application, I have just tested the configuration which passed. 

When the account is made active and logged in, the error only shows when debugging and doesnt appear in the error log at all. 



I have done a few tests and if the user account is inactive etc then in the debugger the error message will display like the example above 3 times. It will also show up in the error log: 

Christopher Kennedy wrote:

Luis, 

I really appreciate all the effort you are going through to troubleshoot this. 

We have LDAP Authentication configured in the Users application, I have just tested the configuration which passed. 

When the account is made active and logged in, the error only shows when debugging and doesnt appear in the error log at all. 



I have done a few tests and if the user account is inactive etc then in the debugger the error message will display like the example above 3 times. It will also show up in the error log: 

When you call the action User_Login are you passing the password? If you are using the LDAP authentication you should pass the password = empty.

Please see more info here: https://www.outsystems.com/forums/discussion/32228/user-login-and-active-directory/#Post110783

Can you test it?

Hope it helps.


Br,

Luis


Hello Luis,

On the User_Login action I set the input parameters to

username = Username, 

rememberLogin = Remember Login

Password = ""

This just stopped the user logging in at all. 


Apologies if I have misunderstood your request.


During my Sync with Active Directory to create users the User.Password attribute is also populated.


Thanks

Chris

Christopher Kennedy wrote:

Hello Luis,

On the User_Login action I set the input parameters to

username = Username, 

rememberLogin = Remember Login

Password = ""

This just stopped the user logging in at all. 


Apologies if I have misunderstood your request.


During my Sync with Active Directory to create users the User.Password attribute is also populated.


Thanks

Chris

You can try to clone the module Users and call the action User_Login from the clone and that way you can debug that action and see why you got that errror


Thanks Luis, 

I think thats the logical next step.

I shall do that, and thank you for your help. If I find a reason for this I shall post a fix on this thread. 

Thanks,

Chris

Solution

Hi Christopher,


The error is showing up, because indeed you are debugging.

If you open up users (go to the users_login action and open users with right-click, this will open up a clone of users, but there you can see what is actually happening)

There you also can find, that indeed it's being logged, but somewhere else ;)



Solution

J. wrote:

Hi Christopher,


The error is showing up, because indeed you are debugging.

If you open up users (go to the users_login action and open users with right-click, this will open up a clone of users, but there you can see what is actually happening)

There you also can find, that indeed it's being logged, but somewhere else ;)



Thanks J, 

I shall check it out, but until I have time to, its just causing an error because im debugging? 

If so I shall mark your reply as the answer 

Chris


J. wrote:

Hi Christopher,


The error is showing up, because indeed you are debugging.

If you open up users (go to the users_login action and open users with right-click, this will open up a clone of users, but there you can see what is actually happening)

There you also can find, that indeed it's being logged, but somewhere else ;)




Hello, 

I have done the debug in my case and don't show that message. As I said before the best approach is to clone the module Users and debug in the action User_Login.


BR,

Luis

Christopher Kennedy wrote:

J. wrote:

Hi Christopher,


The error is showing up, because indeed you are debugging.

If you open up users (go to the users_login action and open users with right-click, this will open up a clone of users, but there you can see what is actually happening)

There you also can find, that indeed it's being logged, but somewhere else ;)



Thanks J, 

I shall check it out, but until I have time to, its just causing an error because im debugging? 

If so I shall mark your reply as the answer 

Chris


I think so yes :)

By any chance, did you set "Break on all exceptions" in the debugger menu?



J. wrote:

Christopher Kennedy wrote:

J. wrote:

Hi Christopher,


The error is showing up, because indeed you are debugging.

If you open up users (go to the users_login action and open users with right-click, this will open up a clone of users, but there you can see what is actually happening)

There you also can find, that indeed it's being logged, but somewhere else ;)



Thanks J, 

I shall check it out, but until I have time to, its just causing an error because im debugging? 

If so I shall mark your reply as the answer 

Chris


I think so yes :)

By any chance, did you set "Break on all exceptions" in the debugger menu?



J,


I did have "break on all exceptions" set! 


I shall mark J's reply as the answer, but will do the debugging as Luis suggests and report back if my findings are different. Thank you for all your help, especially Luis. I really appreciate the time youve taken to assist me with this. 

Hello!

I found in the code where you are getting that error:

- In the action "FailedInternalLoginAudit2" is here is logged the error


As you can see in the code, the validation for that is:


The validation is checking in entity UserMT, you need also to update the flag Is_Active on this entity:


Can you try this?

Hope it helps!


BR,

Luis

Christopher Kennedy wrote:

J. wrote:

Christopher Kennedy wrote:

J. wrote:

Hi Christopher,


The error is showing up, because indeed you are debugging.

If you open up users (go to the users_login action and open users with right-click, this will open up a clone of users, but there you can see what is actually happening)

There you also can find, that indeed it's being logged, but somewhere else ;)



Thanks J, 

I shall check it out, but until I have time to, its just causing an error because im debugging? 

If so I shall mark your reply as the answer 

Chris


I think so yes :)

By any chance, did you set "Break on all exceptions" in the debugger menu?



J,


I did have "break on all exceptions" set! 


I shall mark J's reply as the answer, but will do the debugging as Luis suggests and report back if my findings are different. Thank you for all your help, especially Luis. I really appreciate the time youve taken to assist me with this. 

Hi!

I tested from my side and I have "Break on all exceptions" enable:


I debug my login action and don't got that error (pass action User_Login without any error):


I added in some parts to get the userMT by the username, update the isActive the same as User.is_Active and then updated the UserMT. There is a Commit Transaction action still just before the User_Login Action. 


I still get the error when debugging. 

Christopher Kennedy wrote:

I added in some parts to get the userMT by the username, update the isActive the same as User.is_Active and then updated the UserMT. There is a Commit Transaction action still just before the User_Login Action. 


I still get the error when debugging. 

Hi!

UserMT is a view of all users (across all tenants) so in fact, should not be necessary to update it.

But from my side, I can't replicate the strange behaviour from your test (getting the error message). I think the only way to find the issue is to clone the User_Login action and call it in your code and debug it.