Easy facebook login does not work for website through REST API

Because of CORS, you get this error

XMLHttpRequest cannot load https://www.facebook.com/dialog/oauth/?client_id=1144944195566920&redirect_uri=https://api.backendless.com/v1/users/social/facebook/authorize/2AD8E0F2-F1F0-D1AC-FF02-0070FF033C00&scope=&state=633761624. No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘http://localhost:3000’ is therefore not allowed access.

If you paste the url into browser, everything works. It will redirect to https://api.backendless.com and you get the user JSON. However, you cannot make the request from JavaScript inside a browser because of CORS.

Please let me know if you have any solution for this. I feel I have to use a proper SDK login with Facebook and then post the user to Backendless. If that is the case, please add a warning to the easy login document at https://backendless.com/documentation/users/rest/users_facebook_login.htm

–Gordon

Hi, Gordon!

EasyFacebookLogin is just a quick way to get started but it is not guaranteed to work in all cases.
If easy login in not working for you consider using Facebook SDK and after successful login call Backendless.UserService#LoginWithFacebookSDK method.

I am having the same problem with GoogleSDK login. What should i do to fix?

Do not use “easy login”, we will be deprecating that approach. Instead, use the Facebook SDK to login and then use the API documented under the “Login with Facebook SDK” section.