I
I
Ivan Lucifer2017-02-27 13:00:16
symfony
Ivan Lucifer, 2017-02-27 13:00:16

How to make authorization of different users with one login?

Have a nice day everyone.
In Symfony 3, I connected two tables with users for authorization, everything works, but if the same login is in both tables, then only one of them can log in (passwords are always different).
I would like to know if it is possible to allow authorization of users with the same login using standard Symfony tools, or will I have to write a crutch to their security component?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Maxim Timofeev, 2017-02-27
@webinar

Surely you can, but your problem is not with Symfony, but with the fact that the login is an identifier that must be unique, not for Symfony, in principle, but this is not the case for you.
If this is the result of a merger of two sites, then it is worth making 1 database the main one. And to sort out the logic so that it would look at both databases, but gradually, as logins left everything in only one.

N
newpy, 2017-02-27
@newpy

If I understand correctly, then you'd better make one table with users, and make a second table of user groups. Authorize a group by one login, but have some kind of user ID in the group and a password. And since you are doing it, it is not surprising that only one is allowed.
For example, on the authorization page, you see the "login" input field, enter the group's login there, then, for example, the second field "select user" and the third "password" appear, you select a user from this group, and enter only a password that corresponds only to the selected user. This is the simplest thing that came to mind "the decision in the forehead."

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question