How to get an access token with primary and secondary user_id in payload for linking accounts

So i’m trying to do server-side linking of accounts and the docs mention that i must have an access token with the user_ids of both primary and secondary account within the JWT payload. Now i’m confused as to how to generate such a token. Or am i looking at it the wrong way. Thanks in advance

For server-side account linking, use an Access Token that contains the following items in the payload:

update:users scope
user_id of the primary account as part of the URL
user_id of the secondary account```

Hi @binu

That page no longer has the text you quote. I am not sure of the context, so I can’t say what they meant.

You can access the identities array in a rule to get what you need, that is covered in the current version of the page you quoted.

John

1 Like

Hi @john.gateley,

Thanks for the response. The qouted part is from under the server-side account linking section of the management api tab within the page, though the link extension tab is the one shown by default, sorry for the confusion.

The context is that i’m trying to merge user accounts with the same email using the access token from the management api and the user_id’s of the respective users, as mentioned in the docs. It also mentions that the user_id’s and the scope, update:users must be part of the JWT payload of the access token. I’m confused regarding how i can acquire that.

Binu