I have a Facebook app I'm working on. On the application’s advanced settings tab (on the Facebook developers site), I would like to specify an OAuth redirect URL with a wildcard in it. Each user of my application has its own subdomain (for example, foobar.example.com). I want to specify an OAuth redirect URL, for example *.example.com. I know that for other platforms such as Twitter and LinkedIn, this can be achieved by setting the redirect URL just to example.com, and it will accept redirect URLs with any subdomain, including www. On the "My General Settings" tab, I was able to change the URL from app.example.comto example.com. After that, I can still authenticate from app.example.com, and I'm redirected back to app.example.com/callback, becauseapp.example.com/callbackis in the white list of settings for my application. If I try to authenticate from another subdomain, for example foobar.example.com, after that I will be redirected back to app.example.com/callbackwhat I do not want. I tried changing the redirect URL to example.com, as was the case with the site URL, but then I redirect to example.com/callbackinstead app.example.com/callback. I also tried using a wildcard, for example *.example.com/callback, but Facebook did not allow me to save the settings using the template in the url.
How can I make my redirect URL dynamic, so I don’t have to manually enter hundreds or even thousands of URLs with white color?
source
share