AM Journey Password Validation in Node

Hello

I am writing a custom process / password migration process moving to ForgeRock and have a variable set of target endpoints, realms, etc. that i am going to need to validate users against. To address this, in my script, I am generating a remote endpoint to validate a users password against when needed so it can be migrated. But, within a scripted decision node (javascript), how do I get the userPassword from the current journey so I can use it to authenticate against a remote endpoint before migrating a password. There is the passthrough authentication node, but I am going to have 300+ endpoints based on data values that need to be generated dynamically.

Thanks
Nick

The password fetched from the platform password collector will be in the transient state inside the objectAttributes map:

https://backstage.forgerock.com/docs/am/7.4/scripting-guide/scripting-api-node.html#scripting-api-node-nodeState

Note that transientState and sharedState bindings are deprecated in favor of the nodeState binding. nodeState.get(“objectAttributes”) will fetch from transient state first if it is present. This will likely only contain the password and not other attributes from attribute collector/username collector.

-Rob

1 Like

Robert

Thanks, was able to find this last night. I debugged the flow and there is the nodeStage.get("password").asString() as what i needed. Appreciate the help / follow-up on this.

Thanks
Nick

1 Like

Yep if you are using Password collector, “password” will be in root of transient state. If using Platform password collector, it will be nested in objectAttributes.

Glad you found it.

-Rob