Skip to content

JVM: GoogleAuthProvider.credential() and signInWithCredential() throw NotImplementedError #802

@adjorno

Description

@adjorno

Summary

On JVM (desktop), GoogleAuthProvider.credential() and FirebaseAuth.signInWithCredential() are unimplemented stubs that throw kotlin.NotImplementedError. This makes Google Sign-In on JVM desktop completely non-functional.

Affected versions

  • dev.gitlive:firebase-auth-jvm:2.4.0
  • dev.gitlive:firebase-java-sdk:0.6.3

Reproduction

// Throws kotlin.NotImplementedError: An operation is not implemented.
val credential = GoogleAuthProvider.credential(idToken = "...", accessToken = null)

// Also throws NotImplementedError
Firebase.auth.signInWithCredential(credential)

Verified by decompiling the JVM jars:

firebase-java-sdk-0.6.3.jarGoogleAuthProvider.getCredential():

public static AuthCredential getCredential(String idToken, String accessToken) {
    throw new NotImplementedError();
}

firebase-java-sdk-0.6.3.jarFirebaseAuth.signInWithCredential():

public Task<AuthResult> signInWithCredential(AuthCredential credential) {
    throw new NotImplementedError();
}

Expected behavior

GoogleAuthProvider.credential() should construct an AuthCredential object and signInWithCredential() should call the Identity Toolkit REST API with the provided credential, consistent with how signInWithCustomToken and signInWithEmailAndPassword are implemented in firebase-java-sdk.

Context

The loopback OAuth2 implicit flow (open browser → localhost callback server) works correctly on JVM desktop — we successfully obtain a valid Google id_token. The blocker is that there is no way to exchange it for a Firebase session on JVM.

Implemented methods in firebase-java-sdk (REST-based, working):

  • signInAnonymously()
  • signInWithCustomToken()
  • signInWithEmailAndPassword()
  • createUserWithEmailAndPassword()

Not implemented (throw NotImplementedError):

  • GoogleAuthProvider.getCredential()
  • signInWithCredential()
  • linkWithCredential()

Workaround

The only current workaround is a server round-trip: send the Google id_token to a backend that uses the Firebase Admin SDK to verify it and return a Firebase custom token, then call signInWithCustomToken() on the client.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions