How can I use this in my web app

Hi, can I ask help, I never tried this before implementing on my site, and I need some help please, In my Log-in form I want to put “Login to your facebook account”, if the user will successfully Log-in he/she can use my web app.also is it possilbe that I can get his profile so that I can insert this to my table so that no need for him to regsiter again ?

Thank you in advance.

Facebook has official documentation

can I test this in localhost ?

As long as you are connected to the Internet at the time I don’t see why not.

Actually no if you use the API provided by FB, you get directed to the FB site and then get redirected to the originating URL with a response of logged in and other details.
Local host is not a valid URL.

Must you use localhost?

redirect_uri. The URL that you want to redirect the person logging in back to. This URL will capture the response from the Login Dialog. If you are using this in a webview within a desktop app, this must be set to https://www.facebook.com/connect/login_success.html.

what is webview in a desktop ?

Granted, definitions can be fuzzy.
“desktop app” implies an app that works in the OS
“webview” means “like a browser”
In your case “localhost” may seem like “web” in that a browser can be used to go to the local server, but it’s more like an “app” that runs in your OS

Untested, nay, unexplored, but I think that is how you’ll need to approach it for localhost testing.

localhost is perfectly valid. Remember that it’s your browser doing the redirection, not the server. So if your browser can find localhost then you are good to go. I do this all the time.

I highly recommend using HybridAuth. HybridAuth makes everything super simple.

Thank you , I will try this. :smile:

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.