J
J
jazzus2019-10-20 21:16:12
Database design
jazzus, 2019-10-20 21:16:12

What to do if the user has many social networks during authorization?

I implement authorization through social networks. They suggest adding network_id to users and authorize it like that. But what if the network_id can be multiple? Because the user can have both Google and Facebook, and you never know what he will click there. It turns out that you need to make a new table for data from social networks with user_id, connect with users and write there all the social networks through which he wants to go. Is this the correct approach?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sanes, 2019-10-20
@Sanes

See how HybridAuth is implemented

I
Ivan Shumov, 2019-10-20
@inoise

You can not suffer and use ready-made solutions - called Identity Server. You can install it yourself: Keycloak, for example. Or try SaaS: Auth0. I have named only the brightest representatives.
If you want to do it yourself, then you need to organize the mapping of tokens from social networks and users in your system, as well as do a lot of controls for all this colossus

R
rPman, 2019-10-21
@rPman

each social network has its own column in the users table if you don’t want to put it in a separate

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question