title: How to develop test-automation using Postman when OAuth 2.0 authorization is required
body: <p>I have an ASP.NET Web API 2 which is using OAuth 2.0 for authorization. And let's imagine I have a simple Web API method, like:</p>
  
  <pre><code>GET: http://host/api/profiles/user123   (requires OAuth 2.0 token)
  </code></pre>
  
  <p>So, with <a href="https://www.getpostman.com/" rel="nofollow noreferrer">Postman</a>, it is easy to test this Web API. I get an OAuth token for <code>user123</code> from the Web API OAuthAuthorization method and then I use that token in the header of the HTTP request:</p>
  
  <pre><code>GET /api/profiles/user123   HTTP/1.1
  Host: {host}
  Authorization: Bearer {Token}
  Content-Type: application/json
  Cache-Control: no-cache
  </code></pre>
  
  <p>However, if I save my test and run it later (either by Postman itself or by <a href="https://www.getpostman.com/docs/newman_intro" rel="nofollow noreferrer">Newman</a>), the token will be expired at that time and it won't work.</p>
  
  <p>How can I make <a href="https://www.getpostman.com/docs/newman_intro" rel="nofollow noreferrer">Newman</a> to get a new token automatically for <code>user123</code> and use it in the HTTP request?</p>
  
  <p>Note: I know how to use Postman's <a href="https://www.getpostman.com/docs/helpers" rel="nofollow noreferrer">Authentication helpers</a> to ask for a new token. But this scenario doesn't fit the test-automation. In test-automation, I want to remove any human interaction.</p>