2

I have created a Facebook Application and details are given screen shot !

enter image description here

enter image description here

enter image description here

But when i am clicking on JSF Button Login with Facebook I am getting below exception

Given URL is not allowed by the Application configuration.: One or more of the given URLs is not allowed by the App's settings. It must match the Website URL or Canvas URL, or the domain must be a subdomain of one of the App's domains.

Here are code i am using for redirect

private void redirect(String url, HttpServletResponse response)
            throws IOException {

        String urlSessionID = response.encodeRedirectURL(url);
        response.sendRedirect(urlSessionID);

    }

I tried other solution provided in other question which i found in Stackoverflow but its not worked for me .

if (requestUrl.indexOf("Login.xhtml") > 0) {
            callback = requestUrl.replaceAll("Login.xhtml", "fblogin.xhtml");
        } else if (requestUrl.indexOf("UserRegistration.xhtml") > 0) {
            callback = requestUrl.replaceAll("UserRegistration.xhtml",
                    "fblogin.xhtml");
        }
        service = new ServiceBuilder().provider(FacebookApi.class)
                .apiKey(apiKey).apiSecret(apiSecret).callback(callback)
                .scope("email,offline_access").build();
user3696143
  • 301
  • 2
  • 6
  • 23

1 Answers1

0

I made changes in the application and it worked but only for the user who created application not for other user

enter image description here

user3696143
  • 301
  • 2
  • 6
  • 23