Hi.
> 1. Should I be configuring the regex for script based authentication?
Yes, at least one of the logged in/out indicators must be configured,
otherwise ZAP assumes that the message is authenticated. [1]
> 2. If I don't set something in the regex then my Authentication script
> never fires. Is this expected behaviour?
Yes, per above behaviour.
> 3. My running assumption is that I have to configure something in the
> regex and handle whether or not to authenticate in the script, wiping out
> my stored token if I receive a 401.
Correct, if you get a 401 always you can use that as logged out
indicator. If the script is already generating a token each time is
called you don't need to change it, ZAP will only call it if a new token
is needed.
[1]
https://github.com/zaproxy/zap-core-help/wiki/HelpStartConceptsAuthentication
Best regards.
On 10/07/17 10:00, 'Chris99' via OWASP ZAP User Group wrote:
> I have made some more progress since my last post, but would still
> appreciate any assistance if possible.
>
> The reason for my HTTP Sender script not firing was that it had disabled
> itself, so that was easily remedied by re-enabling it.
>
> I've now got a couple of questions regarding my context's Authentication
> settings. The regex logged in message isn't appropriate for an OAuth 2 JSON
> API, as what tells you you are logged in is having an access token that you
> can use without a generating a 401:
>
> 1. Should I be configuring the regex for script based authentication?
> 2. If I don't set something in the regex then my Authentication script
> never fires. Is this expected behaviour?
> 3. My running assumption is that I have to configure something in the