How to add custom outcome message in ForgeRock journeys?

Hi there,

I got the scenario where we need to display different custom message from different node outcomes, for e.g., I am using “Identify existing user” node, what I want is if user does not exist, I need to again come to this node with message pop “please enter valid user” and like this I have created scripted nodes which need this kind of message.
As I am aware we can use shared.put(“errorMessage”,“…”) which will only display if I reach failure node. But I don’t have that requirement.
Looking for your suggestions!

Thank you in advance!

@Suriya First, be aware in displaying such messages - it gives away informtion that can be used by a hacker. If this tree if for the sole use of internal/operations staff, then that should be fine.

To display a message, use a TextOutput callback: Read-only callbacks :: AM 7.4.0

The look at this example to handle a callback in a scripted decision node: Scripted decision node API :: AM 7.4.0

Drop the scripted decision node into the same page node handling the username input, this will send the callback along with the NameCallback. If using hosted login pages, the message is then displayed when the form is presented.

2 Likes

Hi @patrick_diligent ,

I understand we can utilize callbacks, my concern I want to display that message only when “username” is not found. If I put this in same page node it would display it on first round itself, i.e., before verifying whether user present or not.
Need your inputs…

It’s not quite like you say. Set in shared state some variable with the message you want to display when the user is not found - or whatever text to inform of the authentication state. When the user loops back to the form, the script inspects shared state, find there’s a message text waiting there, and fills the text callback. We actually do this in our project for most of the page nodes.
I would though advise you to set the message to something like “invalid credentials” or “invalid username or password” rather than “enter valid user” as this is a security loophole.

2 Likes