Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

198
Views
how can i login with facebook account?

i wanted to create a login with facebook button, so i created this code:

import { getAuth, signOut,
     onAuthStateChanged, FacebookAuthProvider, signInWithPopup } from "https://www.gstatic.com/firebasejs/9.0.2/firebase-auth.js";

const firebaseConfig = {
  apiKey: "AIzaSyC3GLIN5TBmCDoTfy0dEOgOdvVvqNw-ric",
  authDomain: "auth-project-38aaa.firebaseapp.com",
  projectId: "auth-project-38aaa",
  storageBucket: "auth-project-38aaa.appspot.com",
  messagingSenderId: "431888894254",
  appId: "1:431888894254:web:71bb9b250fbb8a21edd2bf",
  measurementId: "G-6BBPCJ3814"
};

const app = initializeApp(firebaseConfig);
const auth = getAuth(app);

// login with facebook
const facebookProvider = new FacebookAuthProvider();
const signInWithFacebook = document.querySelector('#facebook-icon');
signInWithFacebook.addEventListener('click', (e) => {
    e.preventDefault();

    signInWithPopup(auth, facebookProvider).then((result) => {
        const user = result.user;
    
        const credential = FacebookAuthProvider.credentialFromResult(result);
        const accessToken = credential.accessToken;
    })
    .catch((error) => {
        const errorCode = error.code;
        const errorMessage = error.message;
        const email = error.email;
        const credential = FacebookAuthProvider.credentialFromError(error);
          });

});

when i try to login with facebook it gives me this error message:

Facebook has detected that firebase sign in isn't using a secure connection to transfer information.

can you help to solve this problem, please?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

For these tests you must run them with an SSL connection, if you are testing on localhost you are probably not using SSL.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!