'Invalid value "discord"\' on property provider (Identity provider of the secondary user account being linked)

Hello developers. I trying linking two accounts. Google and Facebook already linked and work great. Now, I want to link those accounts with discord. Here is my code example, but nothing works.

  let x = await axios.post(`${key.auth0Path}/api/v2/users/${firstId}/identities`,
        {
            "provider": "discord",
            "user_id": secondUserId
        },
        {
            headers: {
                'authorization': `Bearer ${accessKey}`,
                'Content-Type': 'application/json'
            }
        }).catch((err) => {
            console.log("from link auth0 ", err);
            res.status(400)
            res.send({ status: err })
            return;
        })

But always got the error
message: 'Payload validation error: \'Invalid value "discord"\' on property provider (Identity provider of the secondary user account being linked).'
How I can solve it?

I see this error with Twitch, Discord, and Reddit. Auth query returned to me oauth2|twitch|{user_id} provider. How I can use this provider properly with the query above?

By the way, Facebook, Google, Linkedin, Twitter work perfectly with the query above.

I found the solution.
You must set this parameter if you want to use oauth2
{ provider: "oauth2", user_id: "twitch|{user_id}" }

1 Like

Perfect! Thanks for sharing it with the rest of community!