问题
When user hits account linking button, it opens a new window. Is that ok ?
Than, in that window i'm rendering html page with account/password fields. When user provide that credentials, i'm checking in database and return user e-mail if user exists.
That's ok.
I'm creating redirect url this way :
var redirect_uri = getUrlParameter('redirect_uri');
console.log(redirect_uri);
var account_linking_token = getUrlParameter('account_linking_token');
console.log(account_linking_token);
My getUrlParameter function :
var getUrlParameter = function getUrlParameter(sParam) {
var sPageURL = decodeURIComponent(window.location.search.substring(1)),
sURLVariables = sPageURL.split('&'),
sParameterName,
i;
for (i = 0; i < sURLVariables.length; i++) {
sParameterName = sURLVariables[i].split('=');
if (sParameterName[0] === sParam) {
return sParameterName[1] === undefined ? true : sParameterName[1];
}
}
};
Then :
My redirect url :
var r2 = redirect_uri + "=" + account_linking_token + "&authorization_code=" + response.message;
message.response is an e-mail.
Here is mentioned that authorization_code can be specified by developer. For example, username, email, etc.
At the end, account linking fails

Any help?
回答1:
Make sure that you are subscribing to the messaging_account_linking event.
来源:https://stackoverflow.com/questions/43234206/account-linking-failed