dotnet add package --version 4.1.0
NuGet\Install-Package -Version 4.1.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="" Version="4.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add --version 4.1.0
#r "nuget:, 4.1.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install as a Cake Addin
#addin nuget:?

// Install as a Cake Tool
#tool nuget:?

build latest version is an unofficial C# implementation of Firebase Authentication and FirebaseUI.

The libraries provide a drop-in auth solution that handles the flows for signing in users with email addresses and passwords, Identity Provider Sign In including Google, Facebook, GitHub, Twitter, Apple, Microsoft and anonymous sign-in.

The solution consists of 5 libraries - a base one and 4 platform specific ones:

  • FirebaseAuthentication<strong>.net</strong> targets .NET Standard 2.0
  • FirebaseAuthentication<strong>.WPF</strong> targets WPF on .NET 6
  • FirebaseAuthentication<strong>.UWP</strong> targets UWP with min version 19041
  • FirebaseAuthentication<strong>.WinUI3</strong> targets WinUI3
  • FirebaseAuthentication<strong>.Maui</strong> targets Maui (TODO)


Either via Visual Studio Nuget package manager, or from command line:

# base package
dotnet add package

# Platform specific FirebaseUI (has dependency on base package)
dotnet add package FirebaseAuthentication.WPF
dotnet add package FirebaseAuthentication.UWP
dotnet add package FirebaseAuthentication.WinUI3
dotnet add package FirebaseAuthentication.Maui

Use the --version option to specify a preview version to install.

Daily preview builds are also available on Just add the following Package Source to your Visual Studio:


In general the terminology and API naming conventions try to follow the official JavaScript implementation, adjusting it to fit the .NET conventions. E.g. signInWithCredential is called SignInWithCredentialAsync because it is meant to be awaited, but otherwise the terminology should be mostly the same.


There are currently 3 sample projects in the samples folder:

  • .NET Core Console application (uses only the base library, no UI)
  • WPF sample with UI
  • UWP sample with UI
  • WinUI3 sample with UI

Feel free to clone the repo and check them out, just don't forget to add your custom API keys and other setup (typically in Program.cs or App.xaml.cs).

alternate text is missing from this package README image


For general Firebase setup, refer to the official documentation which discusses the general concepts and individual providers in detail. You might also want to check out the first two steps in this web documentation. Notice that Firebase doesn't officially support Windows as a platform so you will have to register your application as a web app in Firebase Console.

The base library gives you the same features as the official Firebase SDK Authentication, that is without any UI. Your entrypoint is the FirebaseAuthClient.

// main namespaces
using Firebase.Auth;
using Firebase.Auth.Providers;
using Firebase.Auth.Repository;

// Configure...
var config = new FirebaseAuthConfig
    ApiKey = "<API KEY>",
    AuthDomain = "<DOMAIN>",
    Providers = new FirebaseAuthProvider[]
        // Add and configure individual providers
        new GoogleProvider().AddScopes("email"),
        new EmailProvider()
        // ...
    // WPF:
    UserRepository = new FileUserRepository("FirebaseSample") // persist data into %AppData%\FirebaseSample
    // UWP:
    UserRepository = new StorageRepository() // persist data into ApplicationDataContainer

// ...and create your FirebaseAuthClient
var client = new FirebaseAuthClient(config);

Notice the UserRepository. This tells FirebaseAuthClient where to store the user's credentials. By default the libraries use in-memory repository; to preserve user's credentials between application runs, use FileUserRepository (or your custom implementation of IUserRepository).

After you have your client, you can sign-in or sign-up the user with any of the configured providers.

// anonymous sign in
var user = await client.SignInAnonymouslyAsync();

// sign up or sign in with email and password
var userCredential = await client.CreateUserWithEmailAndPasswordAsync("email", "pwd", "Display Name");
var userCredential = await client.SignInWithEmailAndPasswordAsync("email", "pwd");

// sign in via provider specific AuthCredential
var credential = TwitterProvider.GetCredential("access_token", "oauth_token_secret");
var userCredential = await client.SignInWithCredentialAsync(credential);

// sign in via web browser redirect - navigate to given uri, monitor a redirect to 
// your
// and return the whole redirect uri back to the client;
// this method is actually used by FirebaseUI
var userCredential = await client.SignInWithRedirectAsync(provider, async uri =>
    return await OpenBrowserAndWaitForRedirectToAuthDomain(uri);

As you can see the sign-in methods give you a UserCredential object, which contains an AuthCredential and a User objects. User holds details about a user as well as some useful methods, e.g. GetIdTokenAsync() to get a valid IdToken you can use as an access token to other Firebase API (e.g. Realtime Database).

// user and auth properties
var user = userCredential.User;
var uid = user.Uid;
var name = user.Info.DisplayName; // more properties are available in user.Info
var refreshToken = user.Credential.RefreshToken; // more properties are available in user.Credential

// user methods
var token = await user.GetIdTokenAsync();
await user.DeleteAsync();
await user.ChangePasswordAsync("new_password");
await user.LinkWithCredentialAsync(authCredential);

To sign out a user simply call



The platform specific UI libraries use the FirebaseAuthClient under the hood, but need to be initilized via the static Initialize method of FirebaseUI:

// Initialize FirebaseUI during your application startup (e.g. App.xaml.cs)
FirebaseUI.Initialize(new FirebaseUIConfig
    ApiKey = "<API KEY>",
    AuthDomain = "<DOMAIN>",
    Providers = new FirebaseAuthProvider[]
        new GoogleProvider().AddScopes("email"),
        new EmailProvider()
        // and others
    PrivacyPolicyUrl = "<PP URL>",
    TermsOfServiceUrl = "<TOS URL>",
    IsAnonymousAllowed = true,
    UserRepository = new FileUserRepository("FirebaseSample") // persist data into %AppData%\FirebaseSample

Notice the UserRepository. This tells FirebaseUI where to store the user's credentials. By default the libraries use in-memory repository; to preserve user's credentials between application runs, use FileUserRepository (or your custom implementation of IUserRepository).

FirebaseUI comes with FirebaseUIControl you can use in your xaml as follows:

<Page x:Class="Firebase.Auth.Wpf.Sample.LoginPage"


Toggling the visibility of this UI control is up to you, depending on your business logic. E.g. you could show it as a popup, or a Page inside a Frame etc. You would typically want to toggle the control's visibility in response to the AuthStateChanged event:

// subscribe to auth state changes
FirebaseUI.Instance.Client.AuthStateChanged += this.AuthStateChanged;

private void AuthStateChanged(object sender, UserEventArgs e)
    // the callback is not guaranteed to be on UI thread
    Application.Current.Dispatcher.Invoke(() =>
        if (e.User == null)
            // no user is signed in (first run of the app, user signed out..), show login UI 
        else if (this.loginUIShowing)
            // user signed in (or was already signed in), hide the login UI
            // this event can be raised multiple times (e.g. when access token gets refreshed), you need to be ready for that
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (24)

Showing the top 5 NuGet packages that depend on

Package Downloads

envio de push notifications e emails


Package Description


Package Description


Core library for all API client libraries


Makes using GraphQL in .NET as easy as applying an attribute {Api] to exposed properties and registeting the types using dependecy injection. Wraps the implementation of GraphQL by Joe McBride ( Using this implementation, the consumer needs to define many extra types like GraphTypes, GraphInputTypes, ... which is very time consuming and include repetitive code. We eliminate this pain by using reflection to automatically generate those types.

GitHub repositories (3)

Showing the top 3 popular GitHub repositories that depend on

Repository Stars
The main repository for all the Code Maze guides
C# library for Firebase Realtime Database.
C# library for Firebase Storage
Version Downloads Last updated
4.1.0 58,710 9/7/2023
4.0.2 38,740 2/6/2023
4.0.1 5,104 1/8/2023
4.0.0 1,302 1/4/2023
4.0.0-alpha.2 13,919 2/21/2020
4.0.0-alpha.1 478 1/11/2020
3.7.2 204,395 8/5/2021
3.7.1 41,124 4/6/2021
3.7.0 1,746 4/2/2021
3.6.0 18,062 2/19/2021
3.5.0 3,293 1/30/2021
3.4.0 136,862 11/27/2019
3.3.0 28,117 9/14/2019
3.2.0 81,876 12/7/2018
3.1.0 13,784 10/13/2018
3.0.7 66,133 4/4/2018
3.0.6 8,083 12/14/2017
3.0.5 9,590 4/21/2017
3.0.4 1,791 4/17/2017
3.0.3 1,739 4/13/2017
3.0.2 1,858 4/11/2017
3.0.1 1,673 4/10/2017
3.0.0 2,471 4/6/2017
2.2.0 6,804 1/3/2017
2.1.3 3,129 11/10/2016
2.1.2 3,065 9/8/2016
2.1.1 1,544 9/7/2016
2.1.0 1,501 9/7/2016
2.0.1 1,556 9/5/2016
2.0.0 1,862 6/21/2016
2.0.0-alpha1 1,355 9/5/2016
1.1.1 1,729 6/9/2016
1.1.0 1,531 6/6/2016
1.0.0 1,890 6/6/2016