Thanks for your response.Am using groovy how would I get this method called getRemoteAddress() in groovy? Pls advice.
I tried with the below snipped in groovy but it didn’t work.
import org.forgerock.services.context.ClientContext
logger.info ‘getRemoteAddress**:’+ClientContext.getRemoteAddress() //Offcousre i had logger defined.
Hi Gery,
I tried with the below code in the groovy file I get the below exception.Pls advice.
String remoteHost = context.asContext(ClientContext.class).getRemoteHost();
logger.info ‘remoteHost=:’+remoteHost
Error
Caused by: groovy.lang.MissingMethodException: No signature of method: org.forgerock.services.context.ClientContext.getRemoteHost() is applicable for argument types: () values:
Possible solutions: getRemotePort(), getRemoteUser()
Thanks, Gery for the response. I saw the java dock but how would I retrieve this java method getRemoteAddress in a groovy file? Since am using this in IG.
I tried with the below but it doesn’t work.Did you get a chance to try out this pls? thanks
String remoteHost = context.asContext(ClientContext.class).getRemoteHost();
The Object will be available in the same way in Groovy and Java.
You may have to add the import. import org.forgerock.services.context.ClientContext;
Let us know how it goes.
Hi Gery,
After the import, below is the error am getting.
javax.script.ScriptException: groovy.lang.MissingMethodException: No signature of method: org.forgerock.services.context.ClientContext.getRemoteHost() is applicable for argument types: () values:
Possible solutions: getRemotePort(), getRemoteUser()