I have created a Facebook Application and details are given screen shot !
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();