Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add dynamic/wildcard FACEBOOK Valid OAuth redirect URIs [duplicate]

I want to be able to Facebook login on different subdomains:

(ex: www.123.mywebsite.com, www.456.mywebsite.com)

Is there a way to achieve this? Instead of manually adding them one by one... Like a wildcard perhaps? (ex: www.*.mywebsite.com)

I've read some posts that suggested to make sure the "App Domain" field is set to ex: "mywebsite.com" and the "Site URL" field is to ex: "http://mywebsite.com", while leaving the "Valid OAuth redirect URIs" empty. THIS POST was from 2016... And it used to work

But nowadays it's not possible anymore to leave the "Valid OAuth redirect URIs" blank. It needs at least one..

On top of that, they added a "Strict Mode"

Thanks in advance

like image 943
Tobias Heuts Avatar asked Oct 18 '22 01:10

Tobias Heuts


1 Answers

Two options:

  1. Send the subdomain in the state parameter. Have one domain that handles all the redirects from Facebook and redirects to the appropriate subdomain by the state parameter returning from Facebook.
  2. Use the SDK. it uses post message instead of redirect. (recommended)
like image 142
Boaz Avatar answered Oct 21 '22 00:10

Boaz