I have an angular -ui-router web application.
The code:
window.fbAsyncInit = function () {
console.log('loginCtrl.window.fbAsyncInit: initiating FB ...');
FB.init({
appId: '1058057514286456',
xfbml: true,
version: 'v2.5'
});
(function (d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {
return;
}
js = d.createElement(s);
js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
When I click the login-with-facebook button, it calls:
FB.login(function (response) {
console.log('FB Reg : Response - ' + JSON.stringify(response));
if (response.authResponse) {
console.log('Welcome! Fetching your information.... ');
FB.api('/me', {fields: 'name, email,first_name,last_name,verified'}, function (response) {
$scope.saveUserInfo('$scope.fbRegistration', response);
console.log('fbReg: api response='+JSON.stringify(response));
});
} else {
console.log('fbReg: User cancelled login or did not fully authorize. response='+JSON.stringify(response));
}
});
When I click the facebook login button, a facebook dialog will open with a message:
URL Blocked
This redirect failed because the redirect URI is not whitelisted
in the app’s Client OAuth Settings. Make sure Client and Web OAuth
Login are on and add all your app domains as Valid OAuth Redirect URIs.
What redirect URI is used? Where can i install it?
https://developers.facebook.com/docs/facebook-login/web === nothing on this web page says a redirect URI
https://developers.facebook.com/docs/facebook-login/manually-build-a-login-flow === this has a url call with redirect_uri on it. Should I use this manual method?
https:
client_id={app-id}
&redirect_uri={redirect-uri}
thank