What I want
I have a custom script I want to run that will call a named query to retrieve user information and save it to a Session custom property, taking session.props.auth.user.userName as the parameter. In other words, I want to call this custom script as soon as the userName session property is populated when the user logs in. This script only needs to run after the user has been authenticated.
What I tried
Session Events: Startup, Page Startup, Authentication Challenge, and Message.
Change script on session.props.auth.user.userName
Any recommendations on how I could accomplish this? In none of my attempts was I able to access the username property dynamically.
1: You can create a custom session property set a binding to the property for:
this.props.auth.user.userName
Then you can add a transform as either the script or a trigger to run the existing script.
2: You could do the same using the expression language and runscript
3: If it's just a named query you want to run create a session property with a query binding and have the this.props.auth.user.userName as the parameter.