Search code examples
dialogflow-esactions-on-googleapi-ai

How to create account linking?


I'd like to create AccountLinking to recognize users.

I tried with reference to the links below.

And then when i tried Accout Linking on the actions on Google simulator.

I got this result.

{
"response": "It looks like your Test account is not linked yet",
"audioResponse": "//NExAARc...",
"debugInfo": {
    "sharedDebugInfo": [
        {
            "name": "Account Linking Url",
            "debugInfo": "https://assistant.google.com/services/auth/handoffs/auth/start?provider=my_project_name_dev&scopes=email+name&return_url=https://www.google.com/"
        }
    ]
}}

And then I did a copy & paste that link into my browser.

But i got this result.

400. That’s an error.

Error: invalid_scope

Some requested scopes were invalid. {valid=
[https://www.googleapis.com/auth/userinfo.email], invalid=[name]}

How can I fix it?


Solution

  • The name scope isn't a valid scope. (And the https://www.googleapis.com/auth/userinfo.email scope is valid, but deprecated.)

    See https://developers.google.com/identity/protocols/googlescopes#google_sign-in for the scopes you want, but probably profile and email are the ones you're looking for.