Adding google login is pretty straightforward with EIK. You can use the GoogleSignIn node to get the user to sign in with their Google account and get the token. You can then use this token to authenticate the user with your backend.
Important Note
- The plugin named
GoogleOnlineSubsystemshould be disabled in the project settings. This is because EIK uses its own implementation of the Google Online Subsystem. - The
GoogleSignInnode should be used only once in the project. Using it multiple times can cause issues with the login process.
Here's a step-by-step guide to adding Google login to your project:
Enable Google Sign-In : To use Google Sign-In, you need to enable the Google Sign-In API for your project.
- Go to the Google Developers Console.
- Create a new project or select an existing one.
- In the left sidebar, click on
OAuth consent screen. - On the
User Typepage, selectExternaland clickCreate. - You will have to enter the
App NameandUser Support Emailand clickSave and Continue. (You can skip the other fields if you want to but for a better user experience and to avoid any issues, it is recommended to fill in all the fields.)
- No scopes are required for this project, so click
Save and Continue. - On the Next Screen, you will have option to add test users. You can skip this step by clicking
Save and Continue. - Now you will have reached the last step. Click
Back to Dashboard. - In the left sidebar, click on
Credentials. - Click on
Create credentialsand selectOAuth client ID. - Select
Androidas the application type. - Fill in the required fields and click
Create. This will require you to enter thePackage NameandSHA-1 certificate fingerprint. You can find thePackage Namein theProject Settings->Android->Project Settings. TheSHA-1 certificate fingerprintcan be found in theProject Settings->Android->Keystore. You can also use thekeytoolcommand to get the SHA-1 fingerprint.
- Copy the
Client IDandClient Secretfor later use.
--
- Add Google Sign-In node : Add the
GoogleSignInnode to your UI where you want the user to sign in with Google. You can use theOnSignInSuccessandOnSignInFailureevents to handle the sign-in process.

- Authenticate with EOS : Once the user has signed in with Google, you can use the token to authenticate the user with EOS. You can use the
LoginWithEIKnode to authenticate the user with the token.

- Enable Google Login on EOS Developer Portal : You need to enable Google login on the EOS Developer Portal to allow users to sign in with their Google account. You can do this by going to the
Authenticationsection and enabling theGoogleprovider. The same client id has to be used here which was generated in the Google Developer Console.

And that's it! You have successfully added Google login to your project. You can now use the user's Google account to authenticate them with EOS.