Adding AD user programmatically to the Users table before his login
Application Type
Reactive

I am using the LDAP authentication configuration in my application and it is working fine. I am dealing with a case that AD users needed to be added through the code to the Users OutSystems table before the login. I know that whenever a user is successfully authenticated in the login, it will be replicated to Users automatically.  But, in my case, I need to add the User and his manager to the Users once the user login. I have the manager AD details but I need an API or method if exist to add it to the Users .

mvp_badge
MVP
Solution

Same requirement we have in our mobile app.
We followed below approach.
1.Check if user exist in OS User table or not
2.If user not exist let them create in OS user table and its related table
3.If user exist do not create new user in OS table and allow to browse page

For creating a user on User Entity you can leave null what is non mandatory for that entity.

Hi Kawthar,

using this component it is possible to import contacts directly from AD before they login:

https://www.outsystems.com/forge/component-overview/1023/active-directory

Hi José,

Thank you for your response. I am using this component already for getting AD details using the AD_GetUserDetails. I am not sure how this component helps me adding the user to the OutSystems User table.



You need to build that part, using User table actions.

Thanks, José good idea! But creating users through the "CreateUser" entity action required entering the auto-generated Id, the password, and other fields that I don't want to enter manually. Will keeping them as null identifiers make sense?

mvp_badge
MVP
Solution

Same requirement we have in our mobile app.
We followed below approach.
1.Check if user exist in OS User table or not
2.If user not exist let them create in OS user table and its related table
3.If user exist do not create new user in OS table and allow to browse page

For creating a user on User Entity you can leave null what is non mandatory for that entity.

Thank you Salman. That what I did exactly and it worked perfectly but we have to add it in the Users table with the domain name. 

mvp_badge
MVP

Glad to hear.

Meanwhile you can create some extended entity of User like "User Details" and add the columns in that entity.(add FK UserId i.e. from User entity) in User Details entity)

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.