azureoauthfacebook-appsazure-ad-b2c

Azure B2C + Facebook OAuth (Site URL and Valid OAuth Redirect URIs)


I'm following this guide which says to put the tenant name into the "Valid OAuth Redirect URIs" setting:
https://${your-tenant-name}.b2clogin.com/${your-tenant-id}/oauth2/authresp
so I did, I put my NonProd Azure Tenant which covers my dev/qa/stg environments:
https://mycompanydevtenant.b2clogin.com/mycompanydevtenant/oauth2/authresp

Now in Facebook, I am wondering what i should put as the "Site URL" setting.
My app has 3 different envs which use this 1 tenant. so the site urls are like (this app has the Azure B2C FB and also Google/Apple SingUpSignIn options):
https://mycompanysite-dev.com
https://mycompanysite-qa.com
https://mycompanysite-stg.com

Do I have to create 3 separate Facebook Apps for each env (so only the Site URL is changing, but the OAuth Redirect URI is not)? Or is "Site URL" not really used for anything? like maybe its just used for information purposes, and I can just put anything for it, even my eventual prod website (https://mycompanysite.com). Although I'm skeptical about the latter. f

Thanks!


Solution

  • I tried to reproduce the same in my environment and got the results like below:

    I configured Facebook as an Identity provider:

    enter image description here

    When I run the Application (User Flow), I got the Sign-in Screen like below:

    enter image description here

    Do I have to create 3 separate Facebook Apps for each env ? Or is "Site URL" not really used for anything?

    Note that : Site Url is the base URL of the Application. Specify the Site URL because Facebook needs to confirm that the requests are originating from valid source.

    Reference:

    azure-docs/facebook-federation.md at main · MicrosoftDocs/azure-docs · GitHub by John Flores