Facebook oauth error using keycloak Can't load URL: The domain of this URL isn't included in the app's domains

I am trying to implement social login using keycloak in a react-native application and upon following official keycloak documentation I have hit a dead end. I have correctly configured (according to documentation) the correct redirect URI.

Details-

1.created a new facebook app. Now I have two different web resources. a.) An instance running keycloak server on a docker setup. b.) A dummy web app on a different domain that I am redirecting to using my react native code. I am using react-native-login package and the configuration which goes into their Login.start(config) method is attached below.

2.The website uri is the facebook app setting is same as the redirect uri that keycloak provides upon adding an identity provider.I have double checked my app id and app secret and switched the app to production by giving it a privacy policy on the dummy express aplication I am trying to redirect to.

3.The keycloak server and the dummmy express app I have are on different domains (I don’t see any problems with this but the tutorial I was following had the website and the keycloak server on the same domain with different sub domains could this be the problem).

The error

{
   "error": {
      "message": "Can't load URL: The domain of this URL isn't included in the app's domains. To be able to load this URL, add all domains and sub-domains of your app to the App Domains field in your app settings.",
      "type": "OAuthException",
      "code": 191,
      "fbtrace_id": "Awr-3dCV3zr"
   }
}

config object

const config = {
  url: "https://authserver.ml/auth",
  realm: "Demorealm",
  client_id: "demoFrontEnd",
  redirect_uri: "https://dummyapp.ml/privacypolicy",
  appsite_uri: "https://dummyapp.ml",
  kc_idp_hint: "facebook",
};
  • website URI in facebook = redirect uri by keycloak (according to keycloak documentation) added both the domains in the domains section of facebook app settings under the basic tab.
  • In the Share Redirect Domain Allow List section in advanced settings in facebook app I have added both the URI’s ie. the authentication broker url from keycloak and the uri I am trying to redirect to after a successful login but I get this error everytime
  • Another scenario I have noticed is when I try to give the react-native-login config object a redirection uri that is mentioned in keycloak I get the invalid parameter error from keycloak NOte- the error is arising from facebook’s graph api which means that the authentication request went past the keycloak server and to facebook (https://graph.facebook.com/oauth/authorize?scope=email&state=rest of the url) Any suggestions at this point will be much appreciated.