1

The context

  • a facebook web app
  • facebook SDK 2.5 loaded asynchronously
  • login with facebook feature
  • into Angular 1.5 application
  • localhost and ssl domains to test
  • ssl domains on production
  • all above domains are added to Valid OAuth redirect URIs field on https://developers.facebook.com/apps/xxxx/settings/advanced/

The issue

I followed recommendations to implement facebook login. That appeared to work well with my machine (linux). Then a co-worker told me it was not working on his own (Mac).

Errors were in red facebook popup something like:

  • Please login (not the form, but a text to tell you should log to facebook)
  • The uri is not a part of Valid OAuth redirect URIs list

And after few more test on differents configurations the facebook login work

  • Linux with Chrome: ok
  • Linux with Firefox: ok
  • Linux with Opera: not working
  • certains Mac with Chrome: ok
  • certains Mac with Chrome: not working
  • certains Mac with Firefox: ok
  • certains Mac with Firefox: not working
  • certains Mac with Safari: ok
  • certains Mac with Safari: not working
  • Windows with Chrome: not working
  • Windows with Firefox: not working
  • Windows with Internet Explorer: ok

... so finally quite random.

the clue

Using developer tools on Linux/Opera I saw the redirect_uri was targeting http://test.my-domain.com instead of https://test.my-domain.com

solution 1

Then I tried this:

window.FB._https = true; window.FB.init( ... );

from Facebook JavaScript SDK over HTTPS loading non-secure items

it didn't changed anything.

solution 2

I added non ssl version of my domains to facebook app configuration page. To Valid OAuth redirect URIs field in fact.

this one worked well.

Questions

As it is unclear in documentation. And as you can make distinction between httpand https domains I'm wondering:

Community
  • 1
  • 1
mickro
  • 881
  • 2
  • 11
  • 26
  • Your domain use https? Can you test it with ssllabs.com ? – Tom Apr 04 '16 at 16:17
  • Yes my domain use https. Just did the check. Quite long 2 / 3 mins. This gave me two lines. With an IP and a grade. Both grades are A. – mickro Apr 04 '16 at 16:24
  • And about the list of browsers supported (in the same page) ? – Tom Apr 04 '16 at 16:28
  • in *Handshake Simulation* part, all lines are black TLS 1.0 or green TLS 1.2. Except one version of IE which is red. – mickro Apr 04 '16 at 16:35

1 Answers1

0

After few more try. The only way to make it works seems to be this:

I added non ssl version of my domains to facebook app configuration page. To Valid OAuth redirect URIs field in fact.

mickro
  • 881
  • 2
  • 11
  • 26