Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

Does Saviynt have a supported Javascript methods document/web site?

Community_User
Saviynt Employee
Saviynt Employee
Originally posted on August 6 2019 at 22:17 UTC

Does Saviynt have a supported Javascript methods document/web site? If not, is there an external site that your engineers use and build to? I checked FreshDesk and I don’t see anything in the search results. I'm looking for a Java Doc, or similar technical-level reference guide.
Thanks!-Brent
This message was previously posted on Saviynt's legacy forum by a community user and has been moved over to this forum for continued exposure.
8 REPLIES 8

Community_User
Saviynt Employee
Saviynt Employee
Originally posted on August 9 2019 at 13:39 UTC

Hey Brent,

I'm curious where you are thinking of using those Javascript methods. Are you planning to use those in a workflow interface, or in a customer interface that leverages the API? Or for some configuration fields?

--Jim

This message was previously posted on Saviynt's legacy forum by a community user and has been moved over to this forum for continued exposure.

Community_User
Saviynt Employee
Saviynt Employee
Originally posted on August 9 2019 at 16:55 UTC

I am looking for reference documentation for the connector configuration fields, especially related to mapping attributes to target systems. I am trying to parse "packed" data (e.g. delimited data like attribute1, attribute2, attribute3) into variables that can be then selectively applied to user accounts attributes in OpenLDAP based on the type of user (e.g. student, alumni etc.). If a user is multiple types, they would receive multiple account attributes which are added to a multi-value account attribute in OpenLDAP. It would be helpful to know which Javascript methods are supported by the Saviynt parsing engine to parse the data and conditionally apply it. It would also be helpful to have the ability to put the data into an array that can be positionally selected (e.g. student corresponds to position 0, alumni corresponds to position 1 etc.)



This message was previously posted on Saviynt's legacy forum by a community user and has been moved over to this forum for continued exposure.

Community_User
Saviynt Employee
Saviynt Employee
Originally posted on August 9 2019 at 20:53 UTC

The connector config values, are json, not javascript. For instance, the UPDATEACCOUNTJSON looks like this:

( { samaccountname:${account}, sn:${user.lastname}, cn:${cn}, objectclass:[top,person,organizationalPerson,user], userprincipalname:${userPrincipalName}@saviyntdc.com } )

The left portion is the target attribute, and the right is the value sent during an update. In this example (which is AD centric, but the example still works) shows using a variable with ${variableName} format, as well as a static value (the objectclass), as well as a combo (UPN at the bottom). The variables can reference default object values (like account is really account.name) as well as named attributes (user.lastname) and I think you can also do dynamic attributes.

Building a dynamic attribute that computes the value you want to send to OpenLDAP is probably the way I'd go, since you have zero capability in the update JSON to manipulate data, but you can build what you need in a dynamic attr.


Regarding arrays of data - there are a few places in the tool you can hack a key/value mapping table of sorts, then reference it in a dynamic variable perhaps. (like reuse organizations for instance for that purpose). One of my feature requests is a mapping object in the DB we could use for similar purposes, along with a friendly interface for updating it.


--Jim

This message was previously posted on Saviynt's legacy forum by a community user and has been moved over to this forum for continued exposure.

Community_User
Saviynt Employee
Saviynt Employee
Originally posted on August 9 2019 at 21:29 UTC

I'm aware that the connector configs are JSON configuration, but for some reason I was under the impression we could mix in javascript methods. Your response clears that up :).


I'll look into building a dynamic attribute and I'll second your request feature request for the mapping object.


Thanks for taking the time to respond.

This message was previously posted on Saviynt's legacy forum by a community user and has been moved over to this forum for continued exposure.

Community_User
Saviynt Employee
Saviynt Employee
Originally posted on August 13 2019 at 06:48 UTC

Not sure if this is relevant, but it is possible to dynamically build the JSON using hashmaps, e.g. in case you would want to update an attribute for specific user types, but do nothing for some other user type.


These samples are from AD and REST connector, but I think they would work in other ones as well.


For example:

${
Map map1 = new HashMap();

if (user.employeeType.equals('Employee'))map1.put("l",user?.location);

jsonBuilder = new groovy.json.JsonBuilder(map1);
return jsonBuilder.toString();
}


Also, what I have seen, most of Java ( or JavaScript, I'm not from programmer background so I would not know) methods work, such as:


Modifying date time and parsing:

{

"accountExpires": "${

if (user.customproperty9 != null && user.customproperty9.length() > 0)

{

(((Date.parse("yyyyMMdd hhmmss.SSS",user.customproperty9)).getTime() + 11644473600000L) * 10 * 1000)

}

else if (user.enddate != null)

{

(user.enddate.getTime() + 11644473600000L) * 10 * 1000

}

else

{

'0'

}

}",


Removing illegal characters from password:

"password":\"${password.toCharArray().toList().unique().toString().replaceAll('','').replaceAll(',','').replace('[','').replace(']','')}"





This message was previously posted on Saviynt's legacy forum by a community user and has been moved over to this forum for continued exposure.

Community_User
Saviynt Employee
Saviynt Employee
Originally posted on August 13 2019 at 12:58 UTC

I cannot upvote and +1 and thumbs up your post enough, Mikko. That is gold, right there. Thank you.

--Jim

This message was previously posted on Saviynt's legacy forum by a community user and has been moved over to this forum for continued exposure.

Community_User
Saviynt Employee
Saviynt Employee
Originally posted on August 13 2019 at 22:06 UTC

Mikko, these were extremely helpful, thanks again.

This message was previously posted on Saviynt's legacy forum by a community user and has been moved over to this forum for continued exposure.

Community_User
Saviynt Employee
Saviynt Employee
Originally posted on October 7 2019 at 15:57 UTC

Is it possible to build out the JSON to set a custom attribute on the user during reconciliation. We are doing this currently using a Java method.

This message was previously posted on Saviynt's legacy forum by a community user and has been moved over to this forum for continued exposure.