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.
// Install release version
Install-Package FirebaseAuthentication.net
- .NET Standard 1.1 - see https://github.com/dotnet/standard/blob/master/docs/versions.md for compatibility matrix
- 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
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.");
}
Under Facebook developers page for your app make sure you have a similar setup:
In the developer console make sure you have an OAuth client (set it either as iOS or Android app, that should work).