• Basic Facebook Guide
" How to Install Facebook Farmville Games , Geting Facebook Marketplace App, How to Make Facebook Fan Page, Deleting All Facebook Searches History on FB , How to Login Instagram with Your Facebook , Facebook Marketplace Buy and Sell within Local Community Near Me , How to Deactivate FB Account Temporarily on Facebook, How to View Blocked Facebook List to Unblock blocked Friends , How to Use the “Nearby Me Friends” FB Feature on Facebook , Facebook Customer Care Center & Email Help Supports Contact Addresses "

Sign in Facebook sign in

 create fb page, Sign In Facebook Sign In     No comments   

Sign in Facebook sign in
Sign in Facebook sign in        
Authenticate Using Facebook Login with JavaScript | Firebase
You can let your users authenticate with Firebase using their Facebook accounts by integrating Facebook Login into your app. You can integrate Facebook Login either by using the Firebase SDK to carry out the sign-in flow, or by carrying out the Facebook Login flow manually and passing the resulting access token to Firebase.
Before you begin
Add Firebase to your JavaScript project.
On the Facebook for Developers site, get the App ID and an App Secret for your app.
Enable Facebook Login:
In the Firebase console, open the Auth section.
On the Sign in method tab, enable the Facebook sign-in method and specify the App ID and App Secret you got from Facebook.
Then, make sure your OAuth redirect URI (e.g. my-app-12345.firebaseapp.com/__/auth/handler) is listed as one of your OAuth redirect URIs in your Facebook app's settings page on the Facebook for Developers site in the Product Settings > Facebook Login config.
Handle the sign-in flow with the Firebase SDK

If you are building a web app, the easiest way to authenticate your users with Firebase using their Facebook accounts is to handle the sign-in flow with the Firebase JavaScript SDK. (If you want to authenticate a user in Node.js or other non-browser environment, you must handle the sign-in flow manually.)

To handle the sign-in flow with the Firebase JavaScript SDK, follow these steps:
Create an instance of the Facebook provider object:

var provider = new firebase.auth.FacebookAuthProvider();

Optional: Specify additional OAuth 2.0 scopes that you want to request from the authentication provider. To add a scope, calladdScope. For example:

provider.addScope('user_birthday');

See the authentication provider documentation.
Optional: To localize the provider's OAuth flow to the user's preferred language without explicitly passing the relevant custom OAuth parameters, update the language code on the Auth instance before starting the OAuth flow. For example:

Optional: Specify additional custom OAuth provider parameters that you want to send with the OAuth request. To add a custom parameter, call setCustomParameters on the initialized provider with an object containing the key as specified by the OAuth provider documentation and the corresponding value. For example:

Reserved required OAuth parameters are not allowed and will be ignored. See the authentication provider reference for more details.
Authenticate with Firebase using the Facebook provider object. You can prompt your users to sign in with their Facebook accounts either by opening a pop-up window or by redirecting to the sign-in page. The redirect method is preferred on mobile devices.
To sign in with a pop-up window, call signInWithPopup:

firebase.auth().signInWithPopup(provider).then(function(result){
// This gives you a Facebook Access Token. You can use it to access the Facebook API.
Also notice that you can retrieve the Facebook provider's OAuth token which can be used to fetch additional data using the Facebook APIs.

This is also where you can catch and handle errors. For a list of error codes have a look at the Auth Reference Docs.
To sign in by redirecting to the sign-in page, call signInWithRedirect:

firebase.auth().signInWithRedirect(provider);

Then, you can also retrieve the Facebook provider's OAuth token by calling getRedirectResult when your page loads:

firebase.auth().getRedirectResult().then(function(result) {
if (result.credential) {
// This gives you a Facebook Access Token. You can use it to access the Facebook API.
var token = result.credential.accessToken;
The signed-in user info.
var user = result.user;
}).catch(function(error) {
// Handle Errors here.
var errorCode = error.code;
var errorMessage = error.message;
// The email of the user's account used.
var email = error.email;
// The firebase.auth.AuthCredential type that was used.
var credential = error.credential;

This is also where you can catch and handle errors. For a list of error codes have a look at the Auth Reference Docs.▸
Handling account-exists-with-different-credential Errors
Popup mode
// Step 1.
// User tries to sign in to Facebook.
auth.signInWithPopup(newfirebase.auth.FacebookAuthProvider()).catch(function(error) {
// An error happened.
if (error.code === 'auth/account-exists-with-different-credential') {
// Step 2.
// User's email already exists.
// The pending Facebook credential.
var pendingCred = error.credential;
// The provider account's email address.
var email = error.email;
// Get sign-in methods for this email.
auth.fetchSignInMethodsForEmail(email).then(function(methods) {
// Step 3.
// If the user has several sign-in methods,
// the first method in the list will be the "recommended" method to use.
if (methods[0] === 'password') {
// Asks the user his password.
// In real scenario, you should handle this asynchronously.
var password = promptUserForPassword(); // TODO: implement promptUserForPassword.
auth.signInWithEmailAndPassword(email,password).then(function(user) {
// Step 4a.
return user.link(pendingCred);
}).then(function() {
// Facebook account successfully linked to the existing Firebase user.

// All the other cases are external providers.
// Construct provider object for that provider.
// TODO: implement getProviderForProviderId.
var provider = getProviderForProviderId(methods[0]);
// At this point, you should let the user know that he already has an account
// but with a different provider, and let him validate the fact he wants to
// sign in with this provider.
// Sign in to provider. Note: browsers usually block popup triggered asynchronously,
// so in real scenario you should ask the user to click on a "continue" button
// that will trigger the signInWithPopup.

Related Posts:
  • How do i change my Name
  • How to edit date of birth on Facebook
  • Vidio Facebook
  • Reset my Ig Password
  • Enter date of Birth
  • Facebook book app Download
  • How to share to a group on Facebook
  • Call Instagram Help
  • Change the language on Facebook
  • Vacation countdown clock for Facebook
  • I can t deactivate my Facebook Account
  • Who Viewed My Instagram Account
  • Facebook Login In Mobile Phone l
  • How To Create A Poll On Facebook Profile
auth.signInWithPopup(provider).then(function(result) {
// Remember that the user may have signed in with an account that has a different email
// address than the first one. This can happen as Firebase doesn't control the provider's
// sign in flow and the user is free to login using whichever account he owns.
// Step 4b.
// Link to Facebook credential.
// As we have access to the pending credential, we can directly call the link method.
result.user.linkAndRetrieveDataWithCredential(pendingCred).then(function(usercred){
// Facebook account successfully linked to the existing Firebase user.

  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg
Email ThisBlogThis!Share to XShare to Facebook
Newer Post Older Post Home

0 comments:

Post a Comment

Facebook has greatly reduced the distribution of our stories in our readers' newsfeeds and is instead promoting mainstream media sources. When you share to your friends, however, you greatly help distribute our content. Please take a moment and consider sharing this article with your friends and family. Thank you.

How to Install Facebook Marketplace Near Me App

How to Create a Facebook Business Page

How to Completely Delete Facebook Search History

How to Sign in or Login Instagram with Your Facebook

Marketplace Facebook Buy and Sell within Local Community – Marketplace Facebook Buy Sell App

How to Deactivate FB Account Temporarily on Facebook

How to Find Blocked Facebook List to Unblock blocked Friends

How to Use the “Near Me Friends” Facebook Feature

FB Customer Care Center & Email Help Supports Contact Addresses

How to Install & Play the Facebook Farmville Games
How to Install Facebook Marketplace Near Me App

How to Create a Facebook Business Page

How to Completely Delete Facebook Search History

How to Sign in or Login Instagram with Your Facebook

Marketplace Facebook Buy and Sell within Local Community – Marketplace Facebook Buy Sell App

How to Deactivate FB Account Temporarily on Facebook

How to Find Blocked Facebook List to Unblock blocked Friends

How to Use the “Near Me Friends” Facebook Feature

FB Customer Care Center & Email Help Supports Contact Addresses

How to Install & Play the Facebook Farmville Games

Blog Archive

  • ►  2019 (5)
    • ►  July (5)
  • ▼  2018 (2310)
    • ►  December (2)
    • ►  November (181)
    • ►  October (197)
    • ▼  September (1165)
      • Yahoo mail account sign up
      • Instagram video Icon
      • Add facebook widget to website
      • How to download facebook App
      • Terminate Facebook
      • Restart Facebook
      • How to search for Someone
      • Mobile number Lookup
      • Can you sign up for instagram online
      • Myphone Fb
      • Instagram login sign In
      • My facebook is blocked how do i unblock it
      • How to get more followers on instagram Instantly
      • Page Followers
      • Cannot get Facebook
      • Candy crush saga Android
      • How do i share from facebook to Instagram
      • How to change facebook username Again
      • Whatsapp turn off Facebook
      • Cannot get Facebook
      • Candy crush saga Android
      • How do i share from Facebook
      • how to change facebook username again
      • Whatsapp turn off Facebook
      • Can you hide friends from other friends on Facebook
      • Get off Facebook
      • Gearbox Facebook
      • How to download in facebook Videos
      • Find deleted facebook posts
      • Make your own poll free
      • How to delete list in Facebook
      • Meaning of poke in hindi on Facebook
      • Free online video downloader from any Site
      • Facebook update Verion Download
      • Who viewed my Facebook
      • Facebook logout link Mobile
      • How to delete your old instagram account without P...
      • Our facebook Page
      • Pages for You
      • Facebook new id open Now
      • Can you make a poll on Facebook Page
      • Pet friendly Hotels
      • Goggles
      • Where do you find archived messages on Facebook
      • Facebook blank Page
      • How i change my name in Facebook
      • Unblockedgamescorner
      • How do i delete a group i created on Facebook
      • Forgot Instagram password and Dont have Facebook
      • British army Facebook
      • How to change page url in Facebook
      • Vacation countdown Widget
      • my facebook is blocked how do i unblock it ...
      • Email id login
      • Sign in facebook sign in
      • Mobile facebook Messenger
      • Suspend facebook Page
      • Facebook at work sign up
      • can plus
      • face messenger app
      • How to read archived Facebook Messages
      • www f facebook com login
      • Memories of Facebook
      • Erase Facebook account Forever
      • Download a Messenger App
      • Retrieve lost facebook Password
      • Facebook login friends Search
      • quiz de facebook
      • Poke Poke
      • Fb logout Button
      • How to change name on Facebook before 60 Days
      • How to permanently delete Facebook messages from f...
      • can Instagram
      • How we delete Facebook Account
      • What is followers in Facebook
      • How to convert facebook video to Mp3
      • How to get ur Instagram Password
      • Download Instagram for Tablet
      • How do i know if someone has Facebook Messenger
      • Where can i find location services on Iphone
      • No name Facebook
      • How to unblock ads on Facebook
      • Download foto instagram online
      • How to find a Facebook Stalker
      • Aquarius horoscope Today
      • Facebook login through mobile Number
      • Instagram deleted my Likes
      • Fb sign in and log In Password
      • Delete location on Facebook
      • Log in Facebook Facebook
      • How to unblock ppl on Fb
      • Facebook messenger recovery Tool
      • Facebook operator Number
      • How to know block Facebook
      • Facebook operator Number
      • How to know block Facebook
      • Fejsbuk Log in
      • How to hide Facebook friends list on Mobile
      • How to logout of Instagram on Laptop
      • Can i see who views my Instagram Pictures
    • ►  August (665)
    • ►  July (100)

Copyright © Basic Facebook Guide