Automatically Request for authorization before test?

Hello, I am trying to write a test but have some problem. My API server is secured and require OAuth2 token before use. I can manually get access token by requesting it through ‘authorization’ tab but is there any way to automate so that Postman will automatically request the token before test?

(My token is only valid for 1hour so I need to renew while using it)

Yes, I actually wrote an article on how to do just that.

1 Like