Script based authentication POST method not accepting JSON request body
118 views
Skip to first unread message
Venkataramanan Sekar
unread,
Jul 25, 2023, 3:24:12 PM7/25/23
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to OWASP ZAP User Group
Hi,
Using the Script based authentication I'm trying to automate the OKTA login. I created a script using the script engine ECMAScript: Oracle Nashorn. Refer to the callPost function in this article (https://augment1security.com/authentication/oauth2-authorization-code-flow-authentication-using-owasp-zap-part-1/) and I'm sending a JSON request body {password:"xxxx", username:"xxxx"} but it was not working getting the below response. I tried the same in Postman and curl command it was working as expected.
{"errorCode":"E0000003","errorSummary":"The request body was not well-formed.","errorLink":"E0000003","errorId":"oaeas7-pvADTkmhgwQYcNdnoQ","errorCauses":[]}
thc...@gmail.com
unread,
Jul 25, 2023, 3:32:28 PM7/25/23
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to zaprox...@googlegroups.com
Hi,
I'd suggest proxy curl or postman through ZAP and verify that the
request sent by your auth script is the same as those.
Best regards.
Venkataramanan Sekar
unread,
Jul 25, 2023, 4:01:26 PM7/25/23
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to OWASP ZAP User Group
Hi,
As per your suggestion, I compared the script request and the postman request in Zap. I missed setting the content length in the request header. After the content length, it is working. thanks for your help.