title: Google OAuth 2.0 "error" : "redirect_uri_mismatch"
body: <p>I spend already one day, crashed one glass and I am really angry about it, I do not understand what google want from me, and what is wrong.</p>
  
  <p>I've enabled Google+ Api in developers console
  <img src="https://i.stack.imgur.com/uiTnN.png" alt="google_ api enabled">
  , 
  created new OAuth Client ID
  <img src="https://i.stack.imgur.com/oQ65c.png" alt="client id"></p>
  
  <pre><code>    $ch = curl_init('https://accounts.google.com/o/oauth2/token');
  curl_setopt($ch,CURLOPT_POSTFIELDS,'code=4%2FPp1GWqC6PIr3wNYrZ5kK4T9oitxBoo0fBqBrVNQfE-g.ElKDUjQ7E28SoiIBeO6P2m-0RPaolgI&amp;grant_type=authorization_code&amp;redirect_uri=https%3A%2F%2Fmyprivatedomain.local.com%2Foauth2callback&amp;client_id=%mycliet_id%&amp;client_secret=%mysecret%');
  curl_setopt($ch,CURLOPT_POST,1);
  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
  curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_HEADER, true);
  var_dump(curl_exec($ch));
  </code></pre>
  
  <p>created all like in instructions here: <a href="https://developers.google.com/+/web/signin/server-side-flow" rel="noreferrer">https://developers.google.com/+/web/signin/server-side-flow</a>, gplus button appear on page, and it successfully request access for authorized user. but when I made step 8 <strong>Step 8: Initialize the Google API client library and start the Google+ service</strong>
  my request every time get response <strong>"error" : "redirect_uri_mismatch"</strong></p>
  
  <p>I know, that this error appear when you do not registered redirect_uri in Google Console, or when you make a type mistake in it, but I registered it, and also just for testing tried to setup different urls (changed domain names, changed protocols from https to https), but it never working! I have no idea what else I can check, please advice at least something.</p>