Forum Academy Marketplace Showcase Pricing Features

[SOLVED] FB Login domain problem

I think I figured out how to get it to work with Use Strict Mode for Redirect URIs set to YES. According to facebook they are going to force this in March anyways. So pretty much do what everyone above has said. Make your app domain match your Site URL in “Facebook Login” settings (Settings > Basic: Type the same thing into App Domains and below under Website in Site URL) Then do what @zacmacc said (Facebook Login > Settings), except you can actually keep Strict mode on. If you go to the plugin settings in Bubble, it gives you the option to Use a generic redirect URL. Enter that URL into the Valid OAuth redirect URIs.


1 Like

What solved it for me was setting “Use Restrict Mode for Redirects URIs” to “No” AND just using the site URL specified under APP settings (http://www.domain.com) and not anything else. I got the info from this article

Yes it worked perfectly. Thanks for posting.

If this issue just started happening for you, it’s because Strict URI Matching went into effect March 2018 (as already mentioned by one other person). I found this article explaining the enforcement in December of 2017:

I have a Sprint Boot application that is using spring-social-facebook dependency to authenticate with Facebook. If you’re also using this dependency, the one thing none of the answers address is that the redirect uri needs to be exactly what your app is redirecting to.

In our case, the spring-social-facebook dependency appends /connect/facebook to the login request. So you’ll need to add this to your “Valid OAuth redirect URIs”:

For dev: http://localhost:8080/connect/facebook
For prod: https://yourdomain.com/connect/facebook (replace https with http accordingly)

The above resolved the issue for me. Hope it does for you as well!

1 Like

I’ve already made this change more, still giving the same problem :frowning:

I’ve solved this guys. This WILL work for you, please make sure you follow the instructions carefully. It is partly due to what aashish.patel said, which was 99% correct and he is amazing for it. But here is the extra 1% you’re missing.

Hover over your current Facebook button on your website, look at the URL of the button, your URL should look something like this:

https://www.facebook.com/dialog/oauth?type=web_server&client_id=572550529480769&redirect_uri=https://www.gamerdating.com/social/facebook/connect&response_type=code&scope=email/Cuser_birthday/Cuser_location/Cuser_photos&state=f8d32235ce44509fc409675054e11aa9

The important bit is here:

redirect_uri=https://www.gamerdating.com/social/facebook/connect&response

See? It literally says this is your actual redirect URI, or the Valid OAuth redirect URI that Facebook now needs from you.

Now cut it down to the “&” our site looks like this:

https://www.gamerdating.com/social/facebook/connect

Voila! That was our real redirect URI which we found without any guesswork, by just hovering over our facebook button. Yours will look different.

In the above example aashish.patel used:

For prod: https://yourdomain.com/connect/facebook

But remember your URI is unique to your website, and it can ALWAYS be found in the URL of your Facebook login button. All you need to do to get the URI of your Facebook button is to hover over it, and copy the URL at the button of your browser.

Remember Facebook has now forced you to use Strictmode, but all this is, is it is asking for the exact URI that you are using in your button here.

So for our website, our URI’s now look like this:

This should definitely fix your issues if you suddenly have a problem with people logging into your services after March 17th 2018.

If it helps tell your friends about GamerDating obviously :wink:

3 Likes

A combination of 2 things solved this for me:

  1. Putting the exact full address in the “Valid OAuth redirect URIs” field;
  2. Downloading and using the up-to-date version of PHP SDK (5.6.2).
1 Like

Great answers by everyone! It seems that Facebook made additional changes and the PHP SDK below the most recent one is not working anymore.

bud026’s answer solved it for me:

  • Newest PHP SDK 5.6.2

And don’t forget to do the proper settings on the facebook developers’ site as the people mentioned above.

You saved my day. I just registered on this forum to say thanks.
You earned :heart:. :wink:

This thread is great SEO for Bubble :grin:

I was having this issue for a while so just wanted to share how I fixed it. I set this up for a local dev server for lets say https://myapp.local

The setting that made this work for me was the Valid OAuth Redirect URIs in Facebook Login. I originally has this as https://myapp.local - but then I changed it to the EXACT url that I was using in the Redirect field for my request.

My final working settings are:

In App -> Settings -> Basic:
App Domains: myapp.local
Site URL: https://myapp.local/

In App -> Facebook Login -> Settings:
Valid OAuth Redirect URIs: https://myapp.local/login/facebook/callback

Hello! I have tried EVERYTHING possible to get this to work. When i try to log into the website I’m using this is the whole URL I get
https://www.facebook.com/dialog/oauth?client_id=529790457058278&redirect_uri=http%3A%2F%2Fwww.motionlessinwhitefanfiction.com%2FAccount%2FFacebook%2F&state=bfd52b3762be6663734607a55e8f10b2&scope=email

Which exact part of this do I use? I’ve tried for hours and can’t figure out which exact portion of this I use in the developer app.

Thank you for any help!!

i want to update PHP SDK to 5.6.2 but i dont know how please help ???

You need to install Composer on your machine. Check google for “how to install composer on windows/mac/linux”. Then you need to run the command “composer require facebook/graph-sdk” in the terminal window.
The github repo is here: https://github.com/facebook/php-graph-sdk

1 Like

I’m having a ton of difficulty getting my app linked up with Facebook to use it as a way to login.

I’ve followed everything from above, but to no prevail. Can anyone kindly help?

40

yeah Me too :frowning: i ve update Sdk but still same problem
2018-04-23%2015_37_16-Invite%20de%20commandes

I signed up just to like your post

Your URL is hashed so your :// looks like this: %3A%2F%2F

Change your garbage to this: https://www.facebook.com/dialog/oauth?client_id=529790457058278&redirect_uri=http://www.motionlessinwhitefanfiction.com/Account/Facebook/&state=bfd52b3762be6663734607a55e8f10b2&scope=email

I believe that should work, the bit you cut for facebook is this:

http://www.motionlessinwhitefanfiction.com/Account/Facebook/

Try putting that into strictmode as per my post above and it should work.

Right click on your facebook login button on your website and copy the URL in for me here.

I get that same error when i try to log in this is the url that is show in the facebook dialog:
https://www.facebook.com/v2.12/dialog/oauth?app_id=866665793537033&channel_url=http%3A%2F%2Fstaticxx.facebook.com%2Fconnect%2Fxd_arbiter%2Fr%2F2VRzCA39w_9.js%3Fversion%3D42%23cb%3Df19ad3573239a14%26domain%3D127.0.0.1%26origin%3Dhttp%3A%2F%2F127.0.0.1%2Ff13d7ccc85a46c4%26relation%3Dopener&client_id=866665793537033&display=popup&domain=127.0.0.1&e2e={}&locale=en_US&origin=1&redirect_uri=http%3A%2F%2Fstaticxx.facebook.com%2Fconnect%2Fxd_arbiter%2Fr%2F2VRzCA39w_9.js%3Fversion%3D42%23cb%3Df3f5bd0127f222%26domain%3D127.0.0.1%26origin%3Dhttp%3A%2F%2F127.0.0.1%2Ff13d7ccc85a46c4%26relation%3Dopener%26frame%3Df2bacde3ab5978c&response_type=token%2Csigned_request&return_scopes=true&scope=public_profile%2Cemail%2Cuser_friends%2Cmanage_pages&sdk=joey&version=v2.12

What is the correct redirect url i should add in the valid oauth redirect uris ?