Wednesday, March 25, 2020

ForgeRock OpenAM - Authentication Trees !!!

What could I build with Authentication Trees?

Short answer — a lot!

In the First Article, I have covered some cool things you can do with the Out-Of-The-Box nodes, we will also see how to create custom nodes or access a wealth of custom nodes created by the community.

A simplest way to Implement your own business Logic in a node is by using Scripts in ForgeRock. You can easily write a custom script either in JavaScript or GoovyScript to perform some evaluation & determine the outcome. 

First we will create a Script, to do this navigate to the realm which you have created or to the Top Level realm. 
for e.g.
http://demo.test.com:8080/am/XUI/?realm=/#realms/%2Ftestrealm/scripts

Then Click on the Scripts on the Left Hand Navigation Pane. 






Click on the New Script Button & Enter the name of the Script as shown below. 

Now you need to enter your code & business Logic. you can choose either the JavaScript or GroovyScript. In this example, I have chosen the JavaScript. 

Click on the Validate Button to validate your code & then Save Changes. 

Note the name of the Script & we will use it in our AM Trees. 

Navigate back to the tree we created earlier, and drag a Scripted Decision Node onto the canvas and connect it up. Then select the script and ensure that the outcomes we define in the script (true and false), are entered in the Outcomes field. 



You can now try authenticating again using trees.  
This is very simple example of using Scripts in Node.  common uses of these are calling out to third party services, taking the result and evaluating it to determine an outcome. You can use this as a starting point to develop something more sophisticated.

There are lot of custom examples available on ForgeRock Market Place.

https://backstage.forgerock.com/marketplace/catalogDisplay



Thanks a lot !!!









1 comment:

  1. You have raised an important issue..Thanks for sharing..I would like to read more current affairs from this blog..keep posting..
    digital identity

    ReplyDelete

Okta - Salesforce Single Sign On Integration

 Hi We will be integrating the OKTA SSO with Salesforce application for Single Sign On & MFA solution.  Create your Salesforce free trai...