Code Monkey home page Code Monkey logo

Comments (1)

vonovak avatar vonovak commented on June 19, 2024

Hello and thanks for asking,

We set it up, by adding the 'google-services.json' and 'GoogleService-Info.plist' files.
From my understanding these files add the 'Native' Google Oauth Keys to the App, which this library uses.

they contain the client IDs (web, ios, android) and some more firebase-related stuff. Using these files is not mandatory, because you can provide the IDs as parameters to the module, for example:

    const userInfo = await GoogleOneTapSignIn.signIn({
      webClientId: config.webClientId,
      iosClientId: config.iosClientId,
    });

On Apple it works fine, but for some reason, we need to add the 'webClientId' to the configure call, for it to work on Android.

it'd help to know what exactly the problem is :).

My question is what the 'webClientId' does exactly? Does it only work on Android or also on iOS? If it works on both, what is the purpose of the 'iosClientId'?

The web client ID is usually needed for the ID token, if you want to send it over to your server, for example to create a user account. You will find the web client ID in the "aud" (audience field - identifies the recipients that the JWT is intended for) in the decoded ID token.
It works both on Android and on iOS.

The purpose of iosClientId is to identify your app with Google (in conjunction with bundle identifier). On Android, this is done differently - using the SHA-1 hash of app's signing certificate in conjunction with the package name.

Can we use the 'webClientId' instead of the 'google-services.json'?

google-services.json file is optional so in the scope of google sign in, yes. But you'll have to provide iOS client ID and maybe some other config options too.

Hope this answers the questions, feel free to ask more :)

Thank you 🙂

from google-signin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.