Duplicate AD User

Duplicate AD User

As far I know, once a user logs in into the OutSystems Application, if he belongs to the AD, OS automatically creates a user for him in the database.

The issue we have right now is that our user table is filled up with duplicate user with the same details (name, username, etc) except for the creation date. You would notice that these users didn't login yet in the system. Is there some process doing this?

Things to note:
1. We are using v8 on this application.
2. We do bootstrap the users and we have a logic to check duplicates so it would not be possible insert two records with the same username.

Ideas are highly appreciated.

The image was cropped but these users belong to the same AD domain. I am thinking this is maybe due to an issue with the AD configuration (not on our side) but I just need to pinpoint what exactly is the problem.
I filed this through support but was advised to add audit in our code. The problem is, the 'login' screen action is just a straight forward login and the 'user_login' action is a system action and thus can't be edited.

Any insight is highly appreciated. Thanks!
You can drill down further if you clone your Users module and replace its usage in your application's actual Users references. This will allow you to debug in further detail through your Cloned Users module onto the exact creation of User records with the AD login - which is part of User_Login action flow.

In order to clone your Users module, first open your application module in Service Studio, then navigate to the Logic section and under Dependencies right-click on Users node - you should have it since you're referencing its User_Login public action.

After downloading Users module, Service Studio will ask that since it's a System module it cannot be changed. Click "Open a Clone".

Don't forget to put your original Users system module references back into your application module and wipe this clone (or make an app for it and toggle it offline).

Thanks for your response Pedro.

I just wanted to ask if this behavior is already a known issue or somehow happened to another customer. Currently, it was suddenly not happening anymore. Since we have no control over the customer's AD, we are not sure if the problem is on their side. Well, there is also 'problem' how to explain to the customer what caused the issue. :D
From my experience, this kind of issue has happened before due to different (both fully-qualified and short) AD domain identification. For example, if user logs-in simply with his username (which is mostly common) then Users unified login logic layer will prepend the registered domain (from Users Authentication configuration). But if a different login is done by the same user with the same domain but different qualified name (e.g. outsystems.com\myUserName whereas user had been already registered with outsystems\myUserName) then it might be considered a different user and can thus get created differently. 

However, in all occurrences this was fairly easy to debug and correct (in the application's Common Login flow, if I'm correct, not even touching Users module or configuration). By the way, a temporary solution would be to deactivate one of the users (the one less used) but I wouldn't recommend it since it doesn't fix the issue at all.

Please let me know if this was clear to you, JC.