4

Problem:

In my case what happening is, it is always saying Account Linking Failed

image

What I am doing

following this doc word by word: https://developers.facebook.com/docs/messenger-platform/identity/account-linking/

when I need user to be linked to my app, I send a login button to the user like this:

  http.post(`https://graph.facebook.com/v2.6/me/messages?access_token=${PAGE_ACCESS_TOKEN}`, {
                "recipient": {
                    "id": "2829343507138856"
                },
                "message": {
                    "attachment": {
                        "type": "template",
                        "payload": {
                            "template_type": "button",
                            "text": "Try the log in button!",
                            "buttons": [
                                {
                                    "type": "account_link",
                                    "url": "https://dev-sysborg.auth0.com/authorize?response_type=code&client_id=VYierFrTxMb1Kky3DfPEqUHXaShdmH43"
                                }
                            ]
                        }
                    }
                }
            }).then(() => {
                response.send("ok")
            })

user see this login button like this on their messenger screen:

image

when user try to login by pressing the button, it pops up a new window and open login screen in that window: image

and after entering credentials it redirects to a screen which says Account linking failed,

something like this: image

I am sure there is nothing wrong with the Auth0 configuration because it is working fine with postman and connected very well with some other platforms

someone said I must have to subscribe to account linking event so I have subscribed to these three events: messages, messaging_postbacks, messaging_account_linking

I am Stuck at the end of the story, Please help me out

Inzamam Malik
  • 3,238
  • 3
  • 29
  • 61

0 Answers0