title: POSTMAN, OAuth2 and Google Directory API
body: <p>I'm running into issues when attempting to obtain an OAuth2 authorization token in Postman for the Google Directory Api (this is for an EDU domain)</p>
  
  <p>I have created an Application in the Google developer console and ensured that the API is enabled (Admin SDK), I then created a set of 'Web application' credentials and used '<a href="https://www.getpostman.com/oauth2/callback" rel="nofollow noreferrer">https://www.getpostman.com/oauth2/callback</a>' as the 'Authorized redirect URI' as below (ID and secret removed):</p>
  
  <p><a href="https://i.stack.imgur.com/qYur1.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qYur1.gif" alt="Google Developer console - web app credentials"></a></p>
  
  <p>In Postman I have set the 'Authorization URL' and 'Access token URL' to '<a href="https://accounts.google.com/o/oauth2/auth" rel="nofollow noreferrer">https://accounts.google.com/o/oauth2/auth</a>' and included 'Client ID' and 'Client secret' as obtained from the Developer console. I also included the scope '<a href="https://www.googleapis.com/auth/admin.directory.user" rel="nofollow noreferrer">https://www.googleapis.com/auth/admin.directory.user</a>' as below (ID and secret removed):</p>
  
  <p><a href="https://i.stack.imgur.com/ajvk0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ajvk0.png" alt="POSTMAN OAuth2 token request"></a></p>
  
  <p>When clicking 'Get Access Token' I am presented with an authorization dialog:</p>
  
  <p><a href="https://i.stack.imgur.com/Rg9jX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Rg9jX.png" alt="Auth dialog"></a></p>
  
  <p>When I click 'Allow' POSTMAN presents:</p>
  
  <p><a href="https://i.stack.imgur.com/n0OUn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/n0OUn.png" alt="POSTMAN error"></a></p>
  
  <p>POSTMAN also provides a debug URL which when clicked passes me through another authorization dialog (as above) before the browser presents the following error:</p>
  
  <p><a href="https://i.stack.imgur.com/ptuHj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ptuHj.png" alt="Duplicate headers"></a></p>
  
  <p>Can anyone help with this, I'd really appreciate any pointers!? I'm thinking that its actually an error in the returned header, which means that the OAuth2 part may well be functioning correctly. As POSTMAN is installed as a Chrome extension I have no option to test in another browser.</p>