Skip to content

Instantly share code, notes, and snippets.

Created January 10, 2018 06:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/9830bbd58c6acf1767e65197961b7b2b to your computer and use it in GitHub Desktop.
Save anonymous/9830bbd58c6acf1767e65197961b7b2b to your computer and use it in GitHub Desktop.
Facebook Login Oauth C
********************
Facebook Login Oauth C ->>>
********************
http://shurll.com/c08zi
(Copy & Paste link)
********************
I'm not sure if it still is, and I don't disagree with you, but at the time it was required. Go to Facebook Developers and login with your account. Auth0 only allows one Facebook connection to be configured per tenant. For example, sign in the user in a browser as described in the Handle the sign-in flow manually section, but send the access token to your Node.js application instead of using it in the client app. On the Facebook Login Client OAuth Settings page, you can also set a Deauthorize Callback URL to be called when a user deauthorizes your app. (If you want to authenticate a user in Node.js or other non-browser environment, you must handle the sign-in flow manually.) . var email = error.email; // The firebase.auth.AuthCredential type that was used. You should call these methods from a background script rather than a browser action popup, as the authentication popup will cancel the browser action popup. Select Add a New App from the dropdown in the upper right:. –Mike Purcell Sep 29 '11 at 17:37 I have the exact opposite problem: When logging out of my selfmade app, I'm instantly logged out out of facebook too. Docs are horrid. I'm really at a bit of a loose end, the Facebook documentation is patchy, ambiguous and pretty poor. .. The FB.logout() onclick did not complete fast enough before the redirection. var token = result.credential.accessToken; // . On the Sign in method tab, enable the Facebook sign-in method and specify the App ID and App Secret you got from Facebook. 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. This was suggested by an admin in the Facebook forums some time ago. var errorCode = error.code; var errorMessage = error.message; // The email of the user's account used. Then click the Clients tab and select the applications you wish to enable this connection for. That domain would need to be whitelisted for all supported OAuth providers. var credential = error.credential; // . Once they log-in to facebook they redirect to my site with a code I can exchange for an oauth token. Chrome works without the callback. 6. For example: firebase.auth().languageCode = 'frFR'; // To apply the default browser preference instead of explicitly setting it. Click Save Changes. 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. It's better than the jscript hack I'm using at the moment, and easier than the main facebook logout + session key described around here as well. In order to get a Facebook access token, you have to retrieve the full user's profile, using the Auth0 Management API, and extract the access token from the response. Fortunately, FB PHP SDK has a semi-documented solution (in case the link doesn't lead to getLogoutUrl() function, just search look for it on that page). // The pending Facebook credential. 7. auth.fetchProvidersForEmail(email).then(function(providers) { // Step 3. Facebook Re-Authentication. This article describes how to add login with Facebook to your app 5a02188284
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment