{"id":37476351,"url":"https://github.com/step-up-labs/firebase-authentication-dotnet","last_synced_at":"2026-01-16T07:22:04.210Z","repository":{"id":37432032,"uuid":"60422917","full_name":"step-up-labs/firebase-authentication-dotnet","owner":"step-up-labs","description":"C# library for Firebase Authentication","archived":false,"fork":false,"pushed_at":"2024-09-03T22:17:06.000Z","size":684,"stargazers_count":398,"open_issues_count":46,"forks_count":134,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-12-26T23:48:22.499Z","etag":null,"topics":["firebase","firebase-authentication","firebase-database","firebase-realtime-database"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/step-up-labs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-06-04T17:49:29.000Z","updated_at":"2025-11-02T23:38:13.000Z","dependencies_parsed_at":"2024-12-16T14:37:04.392Z","dependency_job_id":"430ea303-9060-4f2f-8428-d382daaa932e","html_url":"https://github.com/step-up-labs/firebase-authentication-dotnet","commit_stats":{"total_commits":107,"total_committers":20,"mean_commits":5.35,"dds":0.5420560747663552,"last_synced_commit":"419936f8428d1a4efc750b319a00bb643423d42f"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/step-up-labs/firebase-authentication-dotnet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/step-up-labs%2Ffirebase-authentication-dotnet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/step-up-labs%2Ffirebase-authentication-dotnet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/step-up-labs%2Ffirebase-authentication-dotnet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/step-up-labs%2Ffirebase-authentication-dotnet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/step-up-labs","download_url":"https://codeload.github.com/step-up-labs/firebase-authentication-dotnet/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/step-up-labs%2Ffirebase-authentication-dotnet/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28478047,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T06:30:42.265Z","status":"ssl_error","status_checked_at":"2026-01-16T06:30:16.248Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["firebase","firebase-authentication","firebase-database","firebase-realtime-database"],"created_at":"2026-01-16T07:22:03.613Z","updated_at":"2026-01-16T07:22:04.198Z","avatar_url":"https://github.com/step-up-labs.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FirebaseAuthentication.net\n[![build](https://github.com/step-up-labs/firebase-authentication-dotnet/workflows/build/badge.svg)](https://github.com/step-up-labs/firebase-authentication-dotnet/actions)\n[![latest version](https://img.shields.io/nuget/v/FirebaseAuthentication.net)](https://www.nuget.org/packages/FirebaseAuthentication.net)\n[![feedz.io](https://img.shields.io/badge/endpoint.svg?url=https%3A%2F%2Ff.feedz.io%2Fstep-up-labs%2Ffirebase%2Fshield%2FFirebaseAuthentication.net%2Flatest)](https://f.feedz.io/step-up-labs/firebase/packages/FirebaseAuthentication.net/latest/download)\n\nFirebaseAuthentication.net is an unofficial C# implementation of [Firebase Authentication](https://firebase.google.com/docs/auth)\nand [FirebaseUI](https://firebase.google.com/docs/auth). \n\nThe 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.\n\nThe solution consists of 5 libraries - a base one and 4 platform specific ones:\n* FirebaseAuthentication\u003cstrong\u003e.net\u003c/strong\u003e targets [.NET Standard 2.0](https://github.com/dotnet/standard/blob/master/docs/versions.md)\n* FirebaseAuthentication\u003cstrong\u003e.WPF\u003c/strong\u003e targets [WPF on .NET 6](https://github.com/dotnet/wpf)\n* FirebaseAuthentication\u003cstrong\u003e.UWP\u003c/strong\u003e targets [UWP with min version 19041](https://docs.microsoft.com/en-us/windows/uwp/updates-and-versions/choose-a-uwp-version)\n* FirebaseAuthentication\u003cstrong\u003e.WinUI3\u003c/strong\u003e targets [WinUI3](https://learn.microsoft.com/en-us/windows/apps/winui/winui3/)\n* FirebaseAuthentication\u003cstrong\u003e.Maui\u003c/strong\u003e targets Maui (*TODO*)\n\n## Installation\n\nEither via Visual Studio [Nuget](https://www.nuget.org/packages/FirebaseAuthentication.net) package manager, or from command line:\n\n```powershell\n# base package\ndotnet add package FirebaseAuthentication.net\n\n# Platform specific FirebaseUI (has dependency on base package)\ndotnet add package FirebaseAuthentication.WPF\ndotnet add package FirebaseAuthentication.UWP\ndotnet add package FirebaseAuthentication.WinUI3\ndotnet add package FirebaseAuthentication.Maui\n```\n\nUse the `--version` option to specify a [preview version](https://www.nuget.org/packages/FirebaseAuthentication.net/absoluteLatest) to install.\n\nDaily preview builds are also available on [feedz.io](https://feedz.io). Just add the following Package Source to your Visual Studio:\n\n```\nhttps://f.feedz.io/step-up-labs/firebase/nuget/index.json\n```\n\n## Usage\n\nIn general the terminology and API naming conventions try to follow the official JavaScript implementation, adjusting it to fit the .NET conventions. \nE.g. `signInWithCredential` is called `SignInWithCredentialAsync` because it is meant to be `await`ed, but otherwise the terminology should be mostly the same.\n\n\n### Samples\nThere are currently 3 sample projects in the [samples folder](/samples/):\n\n* .NET Core Console application (uses only the base library, no UI)\n* WPF sample with UI\n* UWP sample with UI\n* WinUI3 sample with UI\n\nFeel 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`).\n\n![](art/SampleWPF.png)\n\n### Setup\n\nFor general Firebase setup, refer to the [official documentation](https://firebase.google.com/docs/auth) which discusses the general concepts and individual providers in detail. \nYou might also want to check out the first two steps in this [web documentation](https://firebase.google.com/docs/web/setup). \nNotice 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](https://console.firebase.google.com/).\n\n### FirebaseAuthentication.net\n\nThe base library gives you the same features as the official *Firebase SDK Authentication*, that is without any UI. Your entrypoint is the `FirebaseAuthClient`.\n\n```csharp\n// main namespaces\nusing Firebase.Auth;\nusing Firebase.Auth.Providers;\nusing Firebase.Auth.Repository;\n\n// Configure...\nvar config = new FirebaseAuthConfig\n{\n    ApiKey = \"\u003cAPI KEY\u003e\",\n    AuthDomain = \"\u003cDOMAIN\u003e.firebaseapp.com\",\n    Providers = new FirebaseAuthProvider[]\n    {\n        // Add and configure individual providers\n        new GoogleProvider().AddScopes(\"email\"),\n        new EmailProvider()\n        // ...\n    },\n    // WPF:\n    UserRepository = new FileUserRepository(\"FirebaseSample\") // persist data into %AppData%\\FirebaseSample\n    // UWP:\n    UserRepository = new StorageRepository() // persist data into ApplicationDataContainer\n};\n\n// ...and create your FirebaseAuthClient\nvar client = new FirebaseAuthClient(config);\n```\n\nNotice the `UserRepository`. This tells `FirebaseAuthClient` where to store the user's credentials. \nBy default the libraries use in-memory repository; to preserve user's credentials between application runs, use `FileUserRepository` (or your custom implementation of `IUserRepository`).\n\nAfter you have your `client`, you can sign-in or sign-up the user with any of the configured providers.\n\n```csharp\n// anonymous sign in\nvar user = await client.SignInAnonymouslyAsync();\n\n// sign up or sign in with email and password\nvar userCredential = await client.CreateUserWithEmailAndPasswordAsync(\"email\", \"pwd\", \"Display Name\");\nvar userCredential = await client.SignInWithEmailAndPasswordAsync(\"email\", \"pwd\");\n\n// sign in via provider specific AuthCredential\nvar credential = TwitterProvider.GetCredential(\"access_token\", \"oauth_token_secret\");\nvar userCredential = await client.SignInWithCredentialAsync(credential);\n\n// sign in via web browser redirect - navigate to given uri, monitor a redirect to \n// your authdomain.firebaseapp.com/__/auth/handler\n// and return the whole redirect uri back to the client;\n// this method is actually used by FirebaseUI\nvar userCredential = await client.SignInWithRedirectAsync(provider, async uri =\u003e\n{    \n    return await OpenBrowserAndWaitForRedirectToAuthDomain(uri);\n});\n```\n\nAs you can see the sign-in methods give you a `UserCredential` object, which contains an `AuthCredential` and a `User` objects.\n`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).\n\n```csharp\n// user and auth properties\nvar user = userCredential.User;\nvar uid = user.Uid;\nvar name = user.Info.DisplayName; // more properties are available in user.Info\nvar refreshToken = user.Credential.RefreshToken; // more properties are available in user.Credential\n\n// user methods\nvar token = await user.GetIdTokenAsync();\nawait user.DeleteAsync();\nawait user.ChangePasswordAsync(\"new_password\");\nawait user.LinkWithCredentialAsync(authCredential);\n```\n\nTo sign out a user simply call\n```csharp\nclient.SignOut();\n```\n\n### FirebaseUI\n\nThe platform specific UI libraries use the `FirebaseAuthClient` under the hood, but need to be initilized via the static `Initialize` method of `FirebaseUI`:\n\n```csharp\n// Initialize FirebaseUI during your application startup (e.g. App.xaml.cs)\nFirebaseUI.Initialize(new FirebaseUIConfig\n{\n    ApiKey = \"\u003cAPI KEY\u003e\",\n    AuthDomain = \"\u003cDOMAIN\u003e.firebaseapp.com\",\n    Providers = new FirebaseAuthProvider[]\n    {\n        new GoogleProvider().AddScopes(\"email\"),\n        new EmailProvider()\n        // and others\n    },\n    PrivacyPolicyUrl = \"\u003cPP URL\u003e\",\n    TermsOfServiceUrl = \"\u003cTOS URL\u003e\",\n    IsAnonymousAllowed = true,\n    UserRepository = new FileUserRepository(\"FirebaseSample\") // persist data into %AppData%\\FirebaseSample\n});\n```\n\nNotice the `UserRepository`. This tells FirebaseUI where to store the user's credentials. \nBy default the libraries use in-memory repository; to preserve user's credentials between application runs, use `FileUserRepository` (or your custom implementation of `IUserRepository`).\n\nFirebaseUI comes with `FirebaseUIControl` you can use in your xaml as follows:\n\n```xml\n\u003c!--WPF Sample--\u003e\n\u003cPage x:Class=\"Firebase.Auth.Wpf.Sample.LoginPage\"\n      xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n      xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n      xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" \n      xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\" \n      xmlns:firebase=\"clr-namespace:Firebase.Auth.UI;assembly=Firebase.Auth.UI.WPF\"\n      mc:Ignorable=\"d\" \n      d:DesignHeight=\"450\" \n      d:DesignWidth=\"800\"\u003e\n\n    \u003cGrid\u003e\n        \u003cfirebase:FirebaseUIControl\u003e\n            \u003cfirebase:FirebaseUIControl.Header\u003e\n                \u003c!--Custom content shown above the provider buttons--\u003e\n                \u003cImage \n                    Height=\"150\"\n                    Source=\"/Assets/firebase.png\"\n                    /\u003e\n            \u003c/firebase:FirebaseUIControl.Header\u003e\n        \u003c/firebase:FirebaseUIControl\u003e\n    \u003c/Grid\u003e\n\u003c/Page\u003e\n```\n\nToggling the visibility of this UI control is up to you, depending on your business logic. \nE.g. you could show it as a popup, or a `Page` inside a `Frame` etc. \nYou would typically want to toggle the control's visibility in response to the `AuthStateChanged` event:\n\n```csharp\n// subscribe to auth state changes\nFirebaseUI.Instance.Client.AuthStateChanged += this.AuthStateChanged;\n\nprivate void AuthStateChanged(object sender, UserEventArgs e)\n{\n    // the callback is not guaranteed to be on UI thread\n    Application.Current.Dispatcher.Invoke(() =\u003e\n    {\n        if (e.User == null)\n        {\n            // no user is signed in (first run of the app, user signed out..), show login UI \n            this.ShowLoginUI();\n        }\n        else if (this.loginUIShowing)\n        {\n            // user signed in (or was already signed in), hide the login UI\n            // this event can be raised multiple times (e.g. when access token gets refreshed), you need to be ready for that\n            this.HideLoginUI();\n        }\n    });\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstep-up-labs%2Ffirebase-authentication-dotnet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstep-up-labs%2Ffirebase-authentication-dotnet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstep-up-labs%2Ffirebase-authentication-dotnet/lists"}