title: Google OmniAuth for rails giving error "Missing required parameter: client_id"
body: <p>I need some help. </p>
  
  <p>I have followed all the steps correctly to enable a Google sign in using omniauth. </p>
  
  <p>My Config/Initializers/omniauth.rb</p>
  
  <pre><code>     require 'omniauth-google-oauth2'
       require 'dotenv'
  
          Rails.application.config.middleware.use OmniAuth::Builder do
          provider :google_oauth2,
          ENV["GOOGLE_APP_ID"],
          ENV["GOOGLE_APP_SECRET"]
  .......
  
      end 
  </code></pre>
  
  <p>My routes are correct: </p>
  
  <pre><code>  get    '/auth/google_oauth2/callback', to: 'sessions#googleAuth'
    get    'auth/failure',                 to: redirect('/')
    get    'signout',                      to: 'sessions#destroy', as: 'signout'
  </code></pre>
  
  <p>I have saved credentials properly. </p>
  
  <p>However I am still getting the following error when I click on Google Sign In to redirect to access. </p>
  
  <p>The error is as follows: </p>
  
  <blockquote>
    <ol start="400">
    <li>That’s an error.</li>
    </ol>
    
    <p>Error: invalid_request</p>
    
    <p>Missing required parameter: client_id</p>
    
    <p>Learn more</p>
    
    <p>Request Details access_type=offline client_id= prompt=consent
    redirect_uri=<a href="http://localhost:3000/auth/google_oauth2/callback" rel="nofollow noreferrer">http://localhost:3000/auth/google_oauth2/callback</a>
    response_type=code</p>
  </blockquote>
  
  <p>Why am I getting the missing client_id error, when my project is properly set on the Google Console, everything else is fine. </p>
  
  <p>Please help me get around this. </p>
  
  <p>Thank you!</p>