K
K
kafkiansky2019-06-14 10:11:48
PHP
kafkiansky, 2019-06-14 10:11:48

How to do account linking?

In fact, linking is no different from authorization, as I understand it, with the only difference being that we take data from the social network and do not authorize the user under the linked account, but simply assign it to him. What is the best way to store it in the database? I can’t store all accounts in one table, since I have uniqueness in the email field, and accounts of different social networks have email. address may be the same. Make a table with accounts and a pivot table for linking linked accounts with users? Can you share your own experience, if any?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
Gip, 2019-06-14
@mad_maximus

make a table user_social, and store links to social networks there. one-to-many link by user ID.

I
Ivan Shumov, 2019-06-14
@inoise

If you have decided to write your own Identity Server, then maybe look at ready-made solutions? Auth0 for example cool guys

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question