title: Keep getting Error: redirect_uri_mismatch using youtube api v3
body: <p>Hi I hope someone can help me out here.</p>
  
  <p>I have a Web Application (asp.net) on my local machine, I am trying to upload video to YouTube using this sample <a href="https://developers.google.com/youtube/v3/code%5fsamples/dotnet#upload%5fa%5fvideo">https://developers.google.com/youtube/v3/code_samples/dotnet#upload_a_video</a></p>
  
  <p>I have set up client id and secret for Web application in Google console when I try to upload video a browser tab opens to select one of my google accounts and once I sig in I get redirect_uri_mismatch  the response details on that page are below:</p>
  
  <pre><code>cookie_policy_enforce=false
  scope=https://www.googleapis.com/auth/youtube.upload
  response_type=code
  access_type=offline
  redirect_uri=http://localhost:55556/authorize/
  pageId=[some page id removed here for security reasons]
  display=page
  client_id=[some unique id removed here for security reasons].apps.googleusercontent.com
  </code></pre>
  
  <p>one interesting thing is that the <code>redirect_uri=http://localhost:55556/authorize/</code>  is completely different from the one set up in Google console and the one in client_secrets.json also each time I get the error page the port number changes.</p>
  
  <p>redurect urls and origins are set as follows in Google console I think I have added all combinations just in case:</p>
  
  <p><strong>Authorized redirect URI</strong> </p>
  
  <pre><code>http://localhost/
  https://localhost/
  http://localhost:50169/AddContent.aspx
  https://localhost:50169/AddContent.aspx
  http://localhost:50169
  </code></pre>
  
  <p><strong>Authorized JavaScript origins</strong> </p>
  
  <pre><code>http://localhost/
  https://localhost/
  http://localhost:50169/
  https://localhost:50169/
  </code></pre>
  
  <p>I am not sure why redirect-uri on the error page  does not match any of the 
  Authorized redirect URI I have specified in Google  console ? any ideas ?</p>
  
  <p>Also is it possible that everything is set-up correctly in Google console and my code but this error is triggered by something else like maybe I missed some setting on my you tube account ? I did not make any setting changes since I don't think I have to is that correct ? </p>