Exemplo n.º 1
0
        public void GetLinkedAccountsTest()
        {
            var authProvider = new FirebaseAuthProvider(new FirebaseConfig(ApiKey));
            var email        = $"abcd{new Random().Next()}@test.com";

            var auth           = authProvider.CreateUserWithEmailAndPasswordAsync(email, "test1234").Result;
            var linkedAccounts = authProvider.GetLinkedAccountsAsync(email).Result;

            linkedAccounts.IsRegistered.Should().BeTrue();
            linkedAccounts.Providers.Single().Should().BeEquivalentTo(FirebaseAuthType.EmailAndPassword);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Crea cuenta para firebase
        /// </summary>
        /// <param name="returnUrl">URL sin enviar</param>
        public void LinkAccountsGmail(string returnUrl = null)
        {
            //Autenticación
            var authProvider  = new FirebaseAuthProvider(new FirebaseConfig(ApiKey));
            var emailFirebase = $"DrHelp{new Random().Next()}@gmail.com";


            var auth           = authProvider.CreateUserWithEmailAndPasswordAsync(emailFirebase, "test123456").Result;
            var linkedAccounts = authProvider.GetLinkedAccountsAsync(emailFirebase).Result;

            linkedAccounts.IsRegistered.Should().BeTrue();
            linkedAccounts.Providers.Single().Should().BeEquivalentTo(FirebaseAuthType.EmailAndPassword);
        }
Exemplo n.º 3
0
        private async void firebaseSignin(string email, string password, string username)
        {
            try
            {
                var auth = new FirebaseAuthProvider(new FirebaseConfig(FirebaseAppKey));
                var data = await auth.CreateUserWithEmailAndPasswordAsync(email, password, username);

                var linkedAccounts = await auth.GetLinkedAccountsAsync(email);

                if (linkedAccounts.IsRegistered == true)
                {
                    MessageBox.Show("Success");
                }
            }
            catch (Exception e)
            {
                MessageBox.Show("Error");
            }
        }