18
Views
4
Comments
Solved
[Active Directory CORE (Simplified)] AD_UserLoadToUsers not working once moved to other environment
active-directory-core-simplified
Service icon
Forge asset by Renato Pauleta
Application Type
Service

I am working on an application that heavily uses the AD component, and I am using AD_UserLoadToUsers to add some AD users to the outsystems users table it was working fine on Dev, but once I deployed the code now to QA I am getting "Unspecified error" on this method with no further details. 

Appreciate any help. 

2018-05-29 16-43-16
Renato Pauleta
Solution

Hi Kawthar.

You'll need a token in all the environments where the AD component is installed; that's the way it's built. It uses the token to determine the connection details. The details are stored in the database if you use the demo, which is also a backoffice module for configurations.

Alternatively you can generate your token directly in code or you can use the library directly and just assign the connection details directly. 

UserImage.jpg
Kawthar Ebrahim

Thanks, @Renato Pauleta for your response. can you please let me know which method can help me generate the token directly in the code? 

2018-05-29 16-43-16
Renato Pauleta
Solution

You can use the "ADAccessToken_Save" action from the ActiveDirectory_CS module. Just provide the Name, Domain, Container, DomainUsername and DomainPassword in the Source input parameter and a valid InvokerId (this is a user id, usually the user that's performing the operation).

The action will generate the token internally and you can use the Id output to query the ADAccessToken table to get the correct Token.

UserImage.jpg
Kawthar Ebrahim

Dear @Renato Pauleta 

it seems this behavior is because I have used the token that has been generated on the dev environment. I didn't generate it on QA, it seems the issue is solved now once it got generated in QA, although the same token has been generated. Appreciate it if there is an explanation for this behavior. and what about production? should I move the Demo app to production and generate the token there? or there is an alternative?

2018-05-29 16-43-16
Renato Pauleta
Solution

Hi Kawthar.

You'll need a token in all the environments where the AD component is installed; that's the way it's built. It uses the token to determine the connection details. The details are stored in the database if you use the demo, which is also a backoffice module for configurations.

Alternatively you can generate your token directly in code or you can use the library directly and just assign the connection details directly. 

UserImage.jpg
Kawthar Ebrahim

Thanks, @Renato Pauleta for your response. can you please let me know which method can help me generate the token directly in the code? 

2018-05-29 16-43-16
Renato Pauleta
Solution

You can use the "ADAccessToken_Save" action from the ActiveDirectory_CS module. Just provide the Name, Domain, Container, DomainUsername and DomainPassword in the Source input parameter and a valid InvokerId (this is a user id, usually the user that's performing the operation).

The action will generate the token internally and you can use the Id output to query the ADAccessToken table to get the correct Token.

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