Games 4 min read

Sign in with Google for Unity: The Open-Source Credential Manager Plugin, Setup Gotchas and Backend Token Handling

On Nov 10, 2026 the Android Developers Blog announced the Sign in with Google Mobile Plugin for Unity, now open source on GitHub (googlesamples/siwg-mobile-unity-plugin). It replaces the deprecated sample bridges that, in the blog's words, struggled with modern Gradle pipelines and AndroidX requirements. If you ship a Unity game on Android, this is the first-party route to Credential Manager sign-in. Everything below comes from the announcement and the repository README, both fetched today.

Unity 6.5
engine version the plugin is built and tested for
idToken
the only thing it returns, via C# events
API 34+
minimum Android API level per the README

1. What the plugin actually is

It is a thin native bridge: Kotlin on Android calling Android's Credential Manager, Objective-C++ on iOS calling GIDSignIn. The announcement stresses "native-only bridges" with minimal runtime overhead and no legacy baggage. It is distributed as a pre-built .unitypackage and is licensed Apache-2.0.

The design choice worth noting is that it is backend-agnostic. Instead of owning your session, it hands your C# code a signed Google ID token and stops. From there you can exchange it with Firebase Authentication, Supabase, Auth0 or your own user service.

2. Setup, in the order that avoids pain

  1. Create OAuth credentials in Google Cloud: Web, Android and iOS client IDs.
  2. Install the External Dependency Manager for Unity (EDM4U), then import siwg_unity_mobile_plugin.unitypackage from the repo's Releases.
  3. Open Window > Google Sign-In Native > Settings, enter the Web Client ID and the iOS Reversed Client ID, and save. No manual manifest edits.
  4. Run Assets > External Dependency Manager > Android Resolver > Force Resolve to pull the googleid and androidx libraries.
  5. Create a GoogleSignInManager GameObject, attach GoogleSignInManager.cs, and assign the GoogleSignInNativeSettings asset from Assets/GoogleSignInNative/Resources.

Migrating an existing project: back it up, remove any older Google Sign-In plugin first, and note that Unity will not overwrite your custom baseProjectTemplate.gradle or settingsTemplate.gradle, so you must merge the Kotlin 1.9.24 definitions by hand.

3. The C# API

The surface is deliberately tiny: one call and two static events.

using UnityEngine;

public class AuthController : MonoBehaviour
{
    private void OnEnable()
    {
        GoogleSignInManager.OnSignInCompleted += OnToken;
        GoogleSignInManager.OnSignInFailed += OnError;
    }

    private void OnDisable()
    {
        GoogleSignInManager.OnSignInCompleted -= OnToken;
        GoogleSignInManager.OnSignInFailed -= OnError;
    }

    public void OnLoginButtonPressed() => GoogleSignInManager.Instance.StartSignIn();

    private void OnToken(string idToken) { /* send idToken to your backend */ }

    private void OnError(string error) => Debug.LogError(error);
}

Always unsubscribe in OnDisable, as above: the events are static, so a destroyed scene object that stays subscribed will keep receiving callbacks. Also note the README sample logs a prefix of the token with Substring(0, 15); that call would throw on a shorter string, so do not copy it into production, and never log a full token.

Verify server-side: treat the ID token as untrusted input until your backend validates its signature and audience. The client only proves that Credential Manager returned something; your server decides whether to create a session.

4. Gotchas from the README

5. Why this matters if you are a native Android dev

The announcement frames Unity as powering over half of all mobile titles worldwide, which is why first-launch friction matters. The Android half of this plugin is the same Credential Manager flow you would write in Kotlin, so everything you know about passkeys, one-tap sign-in and token exchange carries over. The useful lesson is architectural: keep the native layer to "get a token", and let your backend own the session.

Adoption checklist: confirm API 34 fits your audience, pin a release tag, merge the Kotlin settings into custom Gradle templates, validate tokens on your server, and add your own sign-out path since the README does not cover one.

Sources: Android Developers Blog, "Powering Seamless Player Sign-In: Introducing the Open-Source Sign in with Google Plugin for Unity" (Nov 10, 2026), and the googlesamples/siwg-mobile-unity-plugin README on GitHub, retrieved Nov 16, 2026.

Comments 0

No comments yet. Be the first to leave one!

Leave a comment