Package selection guidance compiled from public package information, community data, and project usage.
A streamlined wrapper around Firebase Auth that simplifies authentication workflows with minimal code. It reduces complex setup and boilerplate to a single line of code for sign-in and sign-out operations, making it ideal for rapid development. The package enhances developer productivity by abstracting common authentication patterns while maintaining security and compatibility with Firebase's core services. Designed for seamless integration across Android and iOS platforms, it supports secure user management without sacrificing flexibility.
Use cases
Quick authentication setup in new apps
Reducing boilerplate in existing Firebase Auth implementations
Rapid prototyping with user sign-in/out
Simplifying multi-platform auth logic
Enabling fast onboarding flows
Key features
One-line sign-in and sign-out
Minimal configuration required
Cross-platform support (Android & iOS)
Secure session handling
Clean, readable code structure
Suitable for
Beginner Flutter developers
Projects requiring fast auth implementation
Apps with simple authentication needs
Teams prioritizing development speed
Prototypes and MVPs
Considerations
Limited customization compared to raw Firebase Auth
May not suit advanced authentication scenarios
Depends on underlying Firebase Auth stability
Less control over low-level auth events
Not recommended for highly regulated or complex auth systems
Original README
Original README snapshot from the linked source repository. Visit the repository for the latest content.
Firebase Authentication Simplify
Wrapper package of framework of Firebase Auth package that wraps several lines of codes to one line in order to easily use sign-in function.
Why/Who should use this
You may want to use firebase_auth package directly if you need specific customization on sign-in/out logic.
However, although the most of usecases have almost the same signing-in and out codes, it is pain to write redundant codes everytime even if it is just a several lines of code. Especially, when you provide more than 2 sign-in methods.
You will basically write some codes like below for Each of sign-in methods, and you want to manage it seperatly from the widget you use.
// Example of typical Google sign in (What you will do with original packages)finalGoogleSignIn _googleSignIn = GoogleSignIn();
finalFirebaseAuth _auth = FirebaseAuth.instance;
Future<FirebaseUser> _handleSignIn() async {
finalGoogleSignInAccount googleUser = await _googleSignIn.signIn();
finalGoogleSignInAuthentication googleAuth = await googleUser.authentication;
finalAuthCredential credential = GoogleAuthProvider.getCredential(
accessToken: googleAuth.accessToken,
idToken: googleAuth.idToken,
);
finalFirebaseUser user = (await _auth.signInWithCredential(credential)).user;
print("signed in " + user.displayName);
return user;
}
_handleSignIn()
.then((FirebaseUser user) => print(user))
.catchError((e) => print(e));
_handleSignOut() {
...
}
This package has nothing fancy but just do the dirty things for you and what you will have is something like:
So if your priority is 'simplicity' and 'less code' for 3rd party integration, it is worth using this package.
Who should consider NOT using this
Firstly, if your project only uses firebase provided sign-in methods, such as email or phone auth, it is better using firebase_auth package directly.
Secondly, as this package includes several 3rd party sign-ins, such as google, facebook and kakao, it contains related packages which you might not need it. For example, even though you only provide email and google sign-in methods to the customer, your project will still contain facebook or other sign-in packages which is not necessary in your case. If the issue matters to you, I recommend using your own way instead of implementing this package
Currently supporting Sign-ins
[X] Email
[X] Phone
[X] Google
[ ] Google Play Games
[X] Facebook
[X] Kakao
[X] Apple
[ ] GameCenter
[ ] Twitter
[ ] Github
[ ] Line
Support
If the package was useful or saved your time, please do not hesitate to buy me a cup of coffee! ;)
The more caffeine I get, the more useful projects I can make in the future.
Getting Started
NOTE: Only setup what you need. No need to configure all of followings
Caused by com.facebook.FacebookSdkNotInitializedExceptionThe SDK has not been initialized, make sure to call FacebookSdk.sdkInitialize() first.
The crash is happening because facebook auth package checkes the app id even if you do not use it and throws an exception when it is not set properly.
Firebase Auth Setup
This project uses firebase_auth package and is just a wrapper of it. So please make sure you follow setup instruction of firebase_auth.
You basically need to set google services at Android build.gradle files, and then you must add App at Firebase Console.
NOTE: If previous setting is not completed you will get an error like below.
java.lang.IllegalStateException:
DefaultFirebaseAppis not initialized inthis process [package name].
Make sure to call FirebaseApp.initializeApp(Context) first.
Google sign in Setup
Import google_sign_in package and follow the instruction.
Note: Use openssl-0.9.8e_X64 for getting key hash. Otherwise, it will fail to authenticate.
Also, on Windows platform, DO NOT use keytool at powershall using vs code's terminal. Use cmd.
Apple sign in Setup
Import sign_in_with_apple package and follow the instruction there or follow the instruction on this package for setting stuffs on apple developer site only.
Kakao sign in Setup
Import kakao_flutter_sdk package and follow the instruction. Steps are similar to Facebook settings.
Create an app at kakao developer portal.
Set key hash in there.
Note: Use openssl-0.9.8e_X64 for getting key hash. Otherwise, it will fail to authenticate.
Also, on Windows platform, DO NOT use keytool at powershall using vs code's terminal. Use cmd.
For Android,
Set AndroidManfest.xml
For iOS,
Set info.plist and import SDK into xcode before building.
For Firebase,
We need a cloud function which creates custom token with kakao access token. Please refer to below documents.
npm install --save request request-promise to use 'request-promise module'
IMPORTANT: Make sure to call 'createCustomToken' with { provider: "kakaocorp.com" } at 2nd parameter. If not, you won't be able to call sign-out for it.
Note: Either using config.json file or using config 'firebase functions:config:set kakao.appid=your_kakao_app_id' for cloud function is recommended instead of coding it directely into cloud function code.
Then, you can decalre like:
If you encounter below error, follow the link and enable API.
{error: {codePrefix: auth, errorInfo: {code: auth/insufficient-permission, message: Identity and AccessManagement (IAM) API has not been used in project YOUR_PROJECT_ID before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/iam.googleapis.com/overview?project=YOUR_PROJECT_ID then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.; Please refer to https://firebase.google.com/docs/auth/admin/create-custom-tokens for more details on how to use and troubleshoot this feature.}}}
If you see below error, you also need to set Permission of iam.serviceAccounts.signBolb.
{error: {codePrefix: auth, errorInfo: {code: auth/insufficient-permission, message: Permission iam.serviceAccounts.signBlob isrequired to perform this operation on service account projects/-/serviceAccounts/YOUR_PROJECT_NAME@appspot.gserviceaccount.com.; Please refer to https://firebase.google.com/docs/auth/admin/create-custom-tokens for more details on how to use and troubleshoot this feature.}}}
Lastly, as this uses external request, you need to change your plan to 'Blaze'. Otherwise, you will get 500 error.
Usage
Simple Sign-up/in/out
Simply initialize the class you want to sign in for, and call signIn() function. NOTE: If you use it this way, you need to manage 3rd party sign-'out' logic yourself, because 'firebase_auth' package does not support the function yet. It only provides signOut() function which signs out from the firebase, not from 3rd party providers. You also have to manage linking option yourself if needed.
// Signing out using original package of firebase_auth. // IMPORTANT: This will NOT sign out from 3rd party providerFirebaseAuth.instance.signOut();
Using the wrapper (Recommended)
We provide FirebaseAuthProvider so that we can manage sign-out and 3rd party providers' account linking function for you.
Sign-Up / Sign-In
FirebaseAuthProvider.instance.signUpWith(FirebaseWhateverAuthAPI()); // Only works with firebase provided auth. (eg. email)FirebaseAuthProvider.instance.signInWith(FirebaseWhateverAuthAPI());
// Then you can sign-out anywhere. FirebaseAuthProvider.instance.signOut();
NOTE: Good thing to use this way is it does not only sign out from Firestore, but also sign out from 3rd party provider which we can allow user to sign-in with another account to the same provider. Also, you can manage account linking easily.
finalFirebasePhoneAuthAPI phoneAuthAPI = FirebasePhoneAuthAPI(); // Initialize first
phoneAuthAPI.verifyNumber(phoneNumber, ......); // Send phone number to get code
phoneAuthAPI.submitVerificationCode(code); // Submit the 6 digit codeFirebaseAuthProvider.instance.linkCurrentUserWith(phoneAuthAPI); // Then try link (Will get ERROR_INVALID_VERIFICATION_CODE exception if code is wrong)