title: Google OAuth on MVC5 ExternalLoginCallback?error=access_denied
body: <p>I have set up my Google OAuth</p>
  
  <p><img src="https://i.stack.imgur.com/aYVHe.png" alt="enter image description here"></p>
  
  <p>And I have added the code into Startup.Auth.cs</p>
  
  <pre><code> app.UseGoogleAuthentication(new GoogleOAuth2AuthenticationOptions()
      {
          // LRC
          ClientId = "xxxxxxxxx",
          ClientSecret = "xxxxx"
          //CallbackPath = new PathString("/signin-google")
      });
  </code></pre>
  
  <p>But after I chose a google account to log in, it redirected me to the login page again,</p>
  
  <p>I checked the network via Chrome and found that the access was denied.</p>
  
  <blockquote>
    <p><a href="http://www.liferunningclub.com.au/Account/ExternalLoginCallback?error=access_denied" rel="nofollow noreferrer">http://www.liferunningclub.com.au/Account/ExternalLoginCallback?error=access_denied</a></p>
  </blockquote>
  
  <p>I cannot figure it out. </p>
  
  <hr>
  
  <p><strong>Update</strong>
  Now I did something else:</p>
  
  <ol>
  <li>I added an annotation ([RequireHttps]) on the Account Controller</li>
  <li>I enabled the SSL for my project.</li>
  <li>I updated the url and re-direct url in Google Console to https</li>
  </ol>
  
  <p>Tried to log in with Google, after I selected my Google account, it returned the same access_denied.</p>
  
  <p>It would be better if the response from Google could give more detailed information.</p>