Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add multiple facebook callback urls

Tags:

facebook

I have a product (eg: somedomain.com) where people can create their own subdomains (eg http://xyz.somedomain.com) or even map their domains to it (eg: example.com)

Now, I want to offer a feature so that my customers can enable "Login with facebook" feature into their subdomain.

Since facebook requires us to add a list of URLs under "Client OAuth Settings" > "Valid OAuth redirect URIs"

Click for Screenshot

What can I do so that it allows my product's subdomain (eg http://xyz.somedomain.com) or customer domains (eg: example.com)

Thanks

like image 658
Phantom007 Avatar asked Sep 13 '15 15:09

Phantom007


1 Answers

Answering my own question:

If you want your FB app to support wildcard subdomains (for eg http://*.yourdomain.com) then you should leave the "Valid OAuth redirect URIs" field empty in your app. But make sure your "App Domain" field is set to "yourdomain.com" and your "Site URL" field is to "http://yourdomain.com"

I had a hard time figuring this thing out and finally succeeded after a week of research. Hope this will be helpful for people struggling with the same problem.

Bonus tip: In case if your FB app doesn't allow to leave the "Valid OAuth redirect URIs" field empty, try to create a new app. When you create a new fb app, it will set the field empty by default. So leave it as is and you should be fine.

like image 52
Phantom007 Avatar answered Sep 28 '22 00:09

Phantom007