Search code examples
visual-studio-2013asp.net-mvc-5oauth-2.0runtime-errorgoogle-oauth

How to use OAuth for the Google service


I am coding a MVC 5 internet application in VS2013 Ultimate Update 3

I am referring to the following resource for this question: http://www.asp.net/mvc/tutorials/mvc-5/create-an-aspnet-mvc-5-app-with-facebook-and-google-oauth2-and-openid-sign-on

  1. I have navigated to the Google Developers Console.
  2. I have created a new client ID with the correct Authorized JavaScript and correct Authorized redirect URI
  3. I have entered in the client ID and client secret into the ConfigureAuth() public method in theStartup.Auth file

When clicking on the "Log in using your Google Account" button, I am getting the following error:

401. That’s an error.
Error: invalid_client
no application name

Can I please have some help with this?


Solution

  • This error is because you haven't inserted "PRODUCT NAME" in Consent Screen inside Google Developer Console.

    So, log in into Google Developer Console and in Consent Screen, go to "APIs & auth" > "Consent screen" and enter a "PRODUCT NAME".

    Note: Be sure that e-mail address is also provided.