Google Sign in different on production server

0

I want to implement a Google Sign In on an existing asp.net application. I have tested it on my localhost and it works well, but once I deploy on my production server it doesn't. One thing I noticed that is different is the name of the Projet/Application on the screen "Choose an account".

1- Can I use the same Client ID on a test vs production server?

2- If the application name is different on the google sign in page, does it mean there is already a project on my Google organization that sets up an authentication API? I suppose only the admin of the organization would know?

3- How can I debug this?

Here are more details on how I built it:

  • I am using a Javascript call to The Google sign in
  • Once authenticated, I Post the token to an Aspx page which validates the integrity of the token, using GoogleJsonWebSignature.ValidateAsync.
  • Once the token is validated, I confirm the user is in my database to allow the login.

** EDIT **

I discovered that I have an error on my production server that I don't have on my localhost:

System.TypeInitializationException: The type initializer for 'Google.Apis.Json.NewtonsoftJsonSerializer' threw an exception. ---> System.IO.FileLoadException: Could not load file or assembly 'Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

google-signin
google-oauth2
asked on Stack Overflow Jul 3, 2018 by Philippe • edited Jul 16, 2018 by Philippe

1 Answer

0

Finally, my problem was not related to Google Client Id settings, so to answer my question, I can use the same client ID on my local host and production server.

The error was some missing information in my web.config on my production server (since this file wasn't published with the rest of the project). So I added this in my web.config to make it work:

<runtime>
 <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
  <dependentAssembly>
    <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="*********" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-11.0.0.0" newVersion="11.0.0.0" />
  </dependentAssembly>
 </assemblyBinding>
</runtime>
answered on Stack Overflow Jul 16, 2018 by Philippe

User contributions licensed under CC BY-SA 3.0