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)
N
just add callback url you want to be redirected in 'Valid OAuth Redirect URIs' input and define the one you want to be redirected in your fbconfig page, in the 'FacebookRedirectLoginHelper()
' class.
Note: multiple url can be added in 'Valid OAuth Redirect URIs' input. You just need to choose the one you want to be used in the 'FacebookRedirectLoginHelper()
' class.
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.
Hi @Phantom007 how can add support for custom domains as well like example.com, my.com and many more with sub domain of somedomain.com
You can add multiple callback URLs on the "Settings" -> "Advanced" screen. Scroll down to OAuth configuration, add the URLs and then save.