Use facebook login in localhost - facebook

I am doing a project and need to use the facebook API as user login.
The document are clear the usage of the login button of login with facebook.
However, when I test the button on localhost, it gives nothing to me, no error page, no popup windows.
I am using xampp for my local development and the site url that I fill in app setting is http://localhost:8880/atrain/
can someone help? I have searched the internet and change the hosts file but still unsuccessful.

Set up your local server to use the standard http port (80) and use a virtual host with a TLD. It can be a fake TLD such as:
localhost.dev
How you actually accomplish this depends on what type of web-server you are using.

Related

Cannot open Microsoft Dynamics NAV service links in a browser

I need to integrate Microsoft Dynamics NAV web services on the website. They provided me with a list of services URLs to access in a browser to see the XML structure. When I open, I see Sign In window, I enter username and password but window still prompts me to enter details. My IP is whitelisted, server IP as well and I send SOAP requests from server's specific IP. But no results.
I asked them and they told that they can see the XML in a browser. For me, I can imagine why I cannot get any results because if in browser the authentication is not working, it will not work for the server requests too.
I tried to turn off antivirus, restart the internet, tried with other PC,etc...but nothing, same result - looped sign in window
(see the attachment).
Any ideas please? Thanks
This is also not working for me in Chrome. It works in IE/Edge with the credential manager from windows and in Firefox with basic credentials.
You could try to use the Boomerang SOAP and REST Client for Chrome.
I use Web Services only with IE/Edge.
In the background of your Screenshot the page says that you are not authorized (HTTP 401). Is your user also a user in Dynamics NAV/Business Central?

OAuth access_denied on login from all providers after server IP change

We recently changed the IP-address on a server hosting one of our services based on .NET Web API 2.
The service is using OAuth2, providing external logins via Facebook/Google.
We're still using the same server and the same host name for our services, only the IP-address has changed. Now I'm getting back my login URL with "&error=access_denied" whenever I try to login using Facebook/Google.
I have checked every setting in both Facebook's and Google's developer consoles but nothing seems to apply. If I remove the OAuth redirect URI, I get an error that the URL is blocked, so the settings seems to take effect.
What have I missed?
Funny how asking a question makes you think even more outside of the box. The culprit was that wrong DNS-server was set on the web host.
I'll see myself out...

Facebook Login API not working on localhost

I am able to interact with the Facebook Login API from my hosted web server, however when I change these settings to the localhost server I receive the message below. I have also tried adding a port number (80) but with no success. I have researched this question here on SO but it seems that I am missing something.
App Domains: localhost
Site URL: http://localhost/
Erorr: Given URL is not allowed by the Application configuration....
Add the port you are using at your localhost and you will get, you are looking for ....
like http://localhost:62024/

Facebook url not allowed with web, works with cordova

We've got a combination phonegap/web app, and am trying to get facebook logins working.
Everything works fine with phonegap, but with the web, Facebook returns the familiar (to many) Given URL is not allowed by the Application configuration...
I've tried using localhost in the Facebook settings, as well as setting up a host on my local machine which used the same URL as our heroku development box (except it has https, which I don't, of course).
I didn't include the port number in the website with facebook login, when using the host as heroku, but tried both with and without on localhost.
Things I've tried
locally - http:localhost:3000 // the app
on facebook
website with facebook login -> http://localhost, http://localhost:3000
app domains -> localhost
locally - http://our-dev-site.herokuapp.com:3000 //the app
on facebook
website with facebook login => http://our-dev-site.herokuapp.com, http://our-dev-site.herokuapp.com:3000
app domains -> our-dev-site.herokuapp.com
I'm really not sure what else to try here.
Is there somewhere in the facebook responses that they tell you what URL they are expecting?
-------------- update --------------------
I forgot that our javascript files are actually being served on another port number. The domain for the app is localhost:3000, but the javascript is served from localhost:8080. Not sure if this could be part of the problem.

localhost test setup - Facebook not allowing localhost

Been trying to setup my Facebook app which I want to use for Logins to allow me to test it on my Mac's localhost. Facebook is throwing the error "App Domain: http://localhost is not a valid domain." when I try change App Domain of Site URL to localhost or 127.0.0.1
IS there any way to get the facebook login api to redirect the browser to my localhost after authentication?
The way I do it is alias the site I'm working on to something like: http://sitename.loc, and then setup an app used specifically for testing with that as the domain.
An example of how to do this can be found here:
https://stackoverflow.com/a/7493806/1056965
On your local machine you have to setup hosts file to point your site name on local ip address. For example if you have to setup authorization with fb on site example.com put this record in your hosts file
127.0.0.1 example.com
And just start your site localy and facebook oauth will redirect you on example.com and you will get valid token localy.
For setup hosts file on windows help is on this link Windows Hosts Setup
Linux help link Linux hosts
It's simple enough when you find out.
Open /etc/hosts (unix) or C:\WINDOWS\system32\drivers\etc\hosts.
If your domain is foo.com, then add this line:
127.0.0.1 local.foo.com
When you are testing, open local.foo.com in your browser and it should work.
Allready, explained here
How to Test Facebook Connect Locally