Populating K2 Smartobjects from AD Attributes

2.4k Views Asked by At

I am trying to automatically populate an instance of an AD User smartobject from no input parameters. The way I figure it is that if the smartobject is accessed by a user of the Active Directory, it might be able to harvest from that user certain basic parameters of that user's account.

This might be nonsense, for all I know, so please tell me if I'm going about this the wrong way.

I am trying to construct a method for the AD User object that will recognize and recall the credentials of whomever activates it, but I cannot seem to find any service object that accesses the user account by default.

My real goal here is to ensure a user cannot enter a false name in the smartform I am building. My thoughts are that I might check a user's input against their stored AD credentials. It may be there are easier or more practical ways to go about verifying identity, but whatever the case, I'd be grateful for any advice.

1

There are 1 best solutions below

0
On

In the Context Browser, under System Values under Current User, you can get details about the currently authenticated user (unless Anonymous Access is enabled). You won't have to get user input at all, or execute an AD User Smart Object method, if you are trying to guarantee the user is who they say they are.

To get details about the current user from the AD User Smart Object, in the SmartForm rule where you execute the AD User Smart Object's GetuserDetails method input mappings, you can user the current user's Name and other fields from the context browser under System Values. The output parameters will include the user email and display name and other useful details about the user.

Smartforms Rule Example Screenshot