:firebase:auth
Purpose: Firebase Authentication for email/password and Google credentials, with Credential Manager for saved credentials and Google account selection.
Key APIs
| API | What it does |
|---|---|
AuthDataSource / AuthDataSourceImpl | signInWithEmailAndPassword, registerWithEmailAndPassword, signInWithSavedCredentials(activity), signInWithGoogle(activity), registerWithGoogle(activity), signOut() |
getSignInRequest() / registerWithGoogleRequest() | Two separate GetCredentialRequest builders — see the Gotcha below |
Private builder excerpt; other options and the returned request are omitted.
// firebase/auth/src/main/kotlin/dev/atick/firebase/auth/data/AuthDataSourceImpl.kt
private fun getSignInRequest(): GetCredentialRequest {
val getGoogleIdOption = GetGoogleIdOption.Builder().setFilterByAuthorizedAccounts(true)
.setServerClientId(Config.WEB_CLIENT_ID).setAutoSelectEnabled(false).build()
// ...
}Gotchas
The sign-in request offers saved passwords and previously authorized Google accounts. The registration request removes the Google-account filter. Both Google paths use Firebase
signInWithCredential, which can create a Firebase user on first success; filtering is not a Firebase account-existence check. Sign-in does not automatically retry with the filter disabled.Configure Firebase, signing fingerprints and
GOOGLE_WEB_CLIENT_IDas described in the setup guide before using Google credentials. The private request builders above are implementation details; consumers useAuthDataSource.
Related Documentation
Firebase Setup § Credential Manager — account filtering and Firebase first-sign-in behavior
Data Layer — where
AuthRepositoryImpl/ProfileRepositoryImplcall this module