How to refresh Bearer token while testing APIs

186 views
Skip to first unread message

Rakshith Jr

unread,
Mar 6, 2023, 5:13:11 AM3/6/23
to OWASP ZAP User Group
Hello,
I am using openapi swaggerfile to test API which has bearer token which is expiring in 5 minutes,
So how to automate this in zap as this involves Oauth authentication,

Thanks and Regards,
Rakshith JR

Simon Bennetts

unread,
Mar 6, 2023, 6:40:10 AM3/6/23
to OWASP ZAP User Group
You can either configure ZAP to understand Oauth authentication or handle the authentication yourself.

If you choose to handle it yourself then this script may be useful: https://github.com/zaproxy/community-scripts/blob/main/authentication/OfflineTokenRefresh.js

If anyone implements more scripts for handleing Oauth (or any other srt of authentication) then please submit them to the Community Scripts repo :)

Cheers,

Simon
Reply all
Reply to author
Forward
0 new messages