title: redirect_uri_mismatch oauth google login artdarek/oAuth-4-laravel
body: <p>Hi I am using the artdarek oauth for google login in laravel.
  I have written the route like the following: <code>Route::get('usersgoogle','logingoogleController@loginwithGoogle');</code>
  I am using the same code shown in the oauth documentaion <a href="https://github.com/artdarek/oauth-4-laravel" rel="nofollow noreferrer">https://github.com/artdarek/oauth-4-laravel</a>
  (the example for google consumer).</p>
  
  <p>My controller:</p>
  
  <pre><code>class logingoogleController extends BaseController {
  
      public function loginWithGoogle() {
  
          // get data from input
          $code = Input::get( 'code' );
  
          // get google service
          $googleService = OAuth::consumer( 'Google' );
          //echo $googleService;
          // check if code is valid
  
          // if code is provided get user data and sign in
          if ( !empty( $code ) ) {
  
              // This was a callback request from google, get the token
              $token = $googleService-&gt;requestAccessToken( $code );
  
              // Send a request with it
              $result = json_decode( $googleService-&gt;request( 'https://www.googleapis.com/oauth2/v1/userinfo' ), true );
  
              $message = 'Your unique Google user id is: ' . $result['id'] . ' and your name is ' . $result['name'];
              echo $message. "&lt;br/&gt;";
  
              //Var_dump
              //display whole array().
              dd($result);
  
          }
          // if not ask for permission first
          else {
              // get googleService authorization
              $url = $googleService-&gt;getAuthorizationUri();
  
              // return to google login url
              return Redirect::to( (string)$url );
              //echo "Hi";
          }
      }
  
  }
  </code></pre>
  
  <p>Now in the google developers I have created a project,created a client id and have specified the redirect uri like the following: <a href="http://domainname.com/usersgoogle" rel="nofollow noreferrer">http://domainname.com/usersgoogle</a> I have tried with <a href="http://domainname.com/usersgoogle/" rel="nofollow noreferrer">http://domainname.com/usersgoogle/</a> -'/' at the last but every time its showing me redirect_uri_mismatch error. Can any one tell me what is the right way to do it? what I am doing wrong here?</p>
  
  <p>My google console is like the following:
  <img src="https://i.stack.imgur.com/M88pQ.png" alt="enter image description here"></p>
  
  <p>Please help. Thanks in advanced...</p>