Followed following steps: 1. Record ZEST script (tested to be working) 2. Include site in context 3. Add user 4. Select forced user 5. Upload script and select script based authentication 6. Define logout indicator 7. Exclude logout from spider 8. Run Ajax spider selecting context and user
What did I miss?
We detail some ways to diagnose authentication issues here: https://github.com/zaproxy/zaproxy/wiki/FAQformauth :
If the "Forced User Mode disabled - click to enable" button is not enabled then you have not configured enough information for ZAP to authenticate - double check that you have performed all of the above steps.
If you have enable forced user mode and are still not logged in when you access your application then look at the requests in the History tab:
If you need to make multiple requests to login then the best option is to record a Zest authentication script and to test this in isolation first.