Skip to content

EmilAlipiev/firebase-authentication-dotnet

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

84 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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/");
var dinos = await firebase
  .Child("dinosaurs")
  .WithAuth(auth.FirebaseToken)
  .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).

About

C# library for Firebase Authentication

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 100.0%