Hi There,
I am having trouble getting the script based authentication working within ZAP Docker environment.
I modified the GetsWithRedirectThenPost.js and renamed it and got it working with ZAP UI. I then exported the context, which saved the Authentication settings specifically for the script and saved the script which was included in the command line and loaded successfully as per below.
However, I don't understand what the error "does not properly implement the Authentication Script interface." means and how to fix it.
I did load an extra class in the UI, to help with adding hidden form Input fields to the POST request, would that cause a problem or need extra configuration in the container?
6036 [ZAP-IO-Server-1-1] INFO org.zaproxy.zap.authentication.ScriptBasedAuthenticationMethodType - Loaded script:GetsWithRedirectThenPostCustom.js
6038 [ZAP-IO-Server-1-1] ERROR org.zaproxy.zap.authentication.ScriptBasedAuthenticationMethodType - Unable to load Script Based Authentication method. The script GetsWithRedirectThenPostCustom.js does not properly implement the Authentication Script interface.
6098 [ZAP-IO-Server-1-1] ERROR org.zaproxy.zap.extension.api.ContextAPI - null
java.lang.NullPointerException: null
....
I have the following additional options configured
-z "-config script.scripts.name=GetsWithRedirectThenPostCustom.js
-config script.scripts.engine=OracleNashorn
-config script.scripts.type=authentication
-config script.scripts.enabled=true
-config script.scripts.file=/zap/wrk/GetsWithRedirectThenPostCustom.js"
Is there any other settings I need?
Thanks,
Andrew.
:/zap$ java -version
openjdk version "11.0.16" 2022-07-19
OpenJDK Runtime Environment (build 11.0.16+8-post-Debian-1deb11u1)