Skip to content
C# library for Firebase Authentication
C#
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
art Cleaned up Dec 29, 2016
samples/Social Cleaned up Dec 29, 2016
src Update Firebase.Auth.csproj Sep 14, 2019
.gitattributes Initial version Jun 6, 2016
.gitignore Initial version Jun 6, 2016
LICENSE Initial version Jun 6, 2016
README.md Update README.md Apr 19, 2017

README.md

FirebaseAuthentication.net

AppVeyor Build status

Firebase authentication library. It can generate Firebase auth token based on given OAuth token (issued by Google, Facebook...). This Firebase token can then be used with REST queries against Firebase Database endpoints. See FirebaseDatabase.net for a C# library wrapping the Firebase Database REST queries.

Installation

// Install release version
Install-Package FirebaseAuthentication.net

Supported frameworks

Supported scenarios

  • Login with Google / Facebook / Github / Twitter OAuth tokens
  • Anonymous login
  • Login with email + password
  • Create new user with email + password
  • Send a password reset email
  • Link two accounts together

Usage

var authProvider = new FirebaseAuthProvider(new FirebaseConfig(FirebaseApiKey));
var facebookAccessToken = "<login with facebook and get oauth access token>";

var auth = await authProvider.SignInWithOAuthAsync(FirebaseAuthType.Facebook, facebookAccessToken);

var firebase = new FirebaseClient(
  "https://dinosaur-facts.firebaseio.com/",
  new FirebaseOptions
  {
    AuthTokenAsyncFactory = () => Task.FromResult(auth.FirebaseToken) 
  });

var dinos = await firebase
  .Child("dinosaurs")
  .OnceAsync<Dinosaur>();
  
foreach (var dino in dinos)
{
  Console.WriteLine($"{dino.Key} is {dino.Object.Height}m high.");
}

Facebook setup

Under Facebook developers page for your app make sure you have a similar setup:

Logo

Google setup

In the developer console make sure you have an OAuth client (set it either as iOS or Android app, that should work).

You can’t perform that action at this time.