Adding session properties in tree

Is there a way to add multiple session properties in a scripted decision node?

I have an existing Auth Chain with a PAP. The PAP gets a list of the LDAP group memberships, and adds them to the session properties. (in the form “appname”, “appgroupname1|appgroupname2…”)

I’m trying to replace this with a tree. I think, because I’m using variable data from the profile, that I cannot use the session properties node. So I’m trying to using a scripted decision node.

The only example I can find is to add a single property, tacked onto Action.goto(“outcome”).putSessionProperty(“name”, “value”).build()

But I need to add an unknown number of properties, and this only works to add a single property.

@Marc.Priebee this example from @konstantin.lapine is probably of use.

1 Like

Thank you. that helped a lot.

For reference, in case anyone else wants a groovy version. This is my groovy version of the same thing
import org.forgerock.openam.auth.node.api.Action;
…stuff to build a map of roles…
actionBuilder = Action.goTo(“true”);
roleMap.each { entry →
actionBuilder.putSessionProperty(entry.key,entry.value);
}
action = actionBuilder.build();

2 Likes