Idira Identity: How can an administrator pull AD attributes not listed in the script help to use in provisioning script?
Question
When an administrator writes a provisioning script, the attributes listed on the right hand side of the screen, under "Script Help" can be used. For example, to trace some attributes:
trace('DisplayName=' + destination.DisplayName);
trace('DisplayNameSource=' + source.DisplayName);
trace('DescriptionSource=' + source.Description);
trace('EmailSource=' + source.Email);
In the case that the needed attributes are not listed under Script Help, "Undefined". will be returned:
trace('DepartmentSource=' + source.Department);
How can AD attributes, not listed in the script help, be pulled from AD to use in provisioning script?
Environment
Identity App Access Service
Answer
Administrators can leverage one of the below options to pull in attributes from AD for use with the script.
Option One - getSourcePropertyByName
var departmentname = getSourcePropertyByName("department");
trace('department=' + departmentname[0]);
destination.Custom1 = departmentname[0];
In this case, department is being pulled from AD and being set for the Custom1 destination attribute.
Option 2 - source.Get
var departmentname = source.Get("department");
trace('department=' + departmentname);
destination.Custom1 = departmentname;
In this case, department is being pulled from AD and being set for the Custom1 destination attribute.
Option Three - GetDsProperty
destination.PrimaryEmail = source.GetDsProperty("cn")[0] + "@" + GoogleDomain;
In this case, the CN is being pulled from AD and being set for the PrimaryEmail destination attribute.
Reference Notes:
- getSourcePropertyByName - This was our original method, but it will only work for values pre-defined in our code.
- source.Get - This was an original adaptation with SCIM 1.0 however I see this rarely work with obscure attributes so it may be hardcoded like the method above, but I'm not certain.
- source.GetDsProperty - This was implemented when we added SCIM 2.0 and was designed to handle calling to multiple source directories. This value does not check against a hardcoded list and just passes the request to the connector to fetch the requested value by name.
Additional Information
Details
Question:
When an administrator writes a provisioning script, the attributes listed on the right hand side of the screen, under "Script Help" can be used. For example, to trace some attributes:
trace('DisplayName=' + destination.DisplayName);
trace('DisplayNameSource=' + source.DisplayName);
trace('DescriptionSource=' + source.Description);
trace('EmailSource=' + source.Email);
In the case that the needed attributes are not listed under Script Help, "Undefined". will be returned:
trace('DepartmentSource=' + source.Department);
How can AD attributes, not listed in the script help, be pulled from AD to use in provisioning script?
Answer:
Administrators can leverage one of the below options to pull in attributes from AD for use with the script.
Option One - getSourcePropertyByName
var departmentname = getSourcePropertyByName("department");
trace('department=' + departmentname[0]);
destination.Custom1 = departmentname[0];
In this case, department is being pulled from AD and being set for the Custom1 destination attribute.
Option 2 - source.Get
var departmentname = source.Get("department");
trace('department=' + departmentname);
destination.Custom1 = departmentname;
In this case, department is being pulled from AD and being set for the Custom1 destination attribute.
Option Three - GetDsProperty
destination.PrimaryEmail = source.GetDsProperty("cn")[0] + "@" + GoogleDomain;
In this case, the CN is being pulled from AD and being set for the PrimaryEmail destination attribute.
Reference Notes:
- getSourcePropertyByName - This was our original method, but it will only work for values pre-defined in our code.
- source.Get - This was an original adaptation with SCIM 1.0 however I see this rarely work with obscure attributes so it may be hardcoded like the method above, but I'm not certain.
- source.GetDsProperty - This was implemented when we added SCIM 2.0 and was designed to handle calling to multiple source directories. This value does not check against a hardcoded list and just passes the request to the connector to fetch the requested value by name.