Active Directory Question (user that belongs to AD login for the first time in OutS)

Active Directory Question (user that belongs to AD login for the first time in OutS)

  
I know that when a user that belongs to the AD logs into the Outsystems Application for the first time, Outsystems automatically creates a user profile/record for that user.

So we had created users data on excel for import into the OS App. This excel bootstrap also includes the associate of roles to the users. So basically something like below:

1. Upload the excel file into the application.

2. Application reads the record with username '12345' and insert it into the database.

3. On that same function '12345' is associated with role, manager.

Works perfect. But now comes the problem. User with login '12345' logs into the application. The AD authenticates the user and was able to login into the system but he has no permission on the application. The reason is that the system treated this user as a different user and by default created a new user with username 'DOMAIN\12345' instead.

Other points I have investigated (credentials specified are present in the AD):

1. If the user is inside the corporate network (inside the domain), when he first log into the system, a user with 'DOMAIN\username' is created.

2. If the user is outside the corporate network (e.g. cellphone on mobile data), when he first log into the system, a user with 'username' is created.

3. The next time the user logs into the system, whether he is inside or outside the corporate network, no new user is created and treats the 'username' same as 'DOMAIN\username', vice versa. This I believe should be the expected behaviour which is not happening for item 1 and 2 (first time log-in).

Anything I am missing?