Skip to content

How to Use multiple User Providers #8582

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
cybernet opened this issue Nov 2, 2017 · 3 comments
Closed

How to Use multiple User Providers #8582

cybernet opened this issue Nov 2, 2017 · 3 comments
Labels
hasPR A Pull Request has already been submitted for this issue. Security

Comments

@cybernet
Copy link

cybernet commented Nov 2, 2017

On my symfony project i have setup 2 multiple user providers
i need to know how the user logged in ? trough what provider so i can use it in a controller
for instance, i have a single login page, depending on what provider is used i wanted to redirect him to a different route

i didn't find anything in the documentation on how to achieve this ( https://symfony.com/doc/current/security/multiple_user_providers.html )

@xabbuh
Copy link
Member

xabbuh commented Nov 3, 2017

Basically, you will do that by checking which UserInterface implementation is stored in the token. As each provider must have a way to detect whether or not it supports the currently logged in user you can use the same approach to check which provider was loading the user.

Is it needed to add this information to the existing article?

@cybernet
Copy link
Author

cybernet commented Nov 5, 2017

look, i'm a beginner, for me, of course is needed, but for others ... i don't know ( i also have no idea how to do that, but i will try :) )

that depends on what kind of programmers symfony is addressed to ...

@javiereguiluz javiereguiluz added Missing Documentation Security hasPR A Pull Request has already been submitted for this issue. labels May 3, 2018
javiereguiluz added a commit that referenced this issue May 24, 2018
This PR was squashed before being merged into the 2.7 branch (closes #9726).

Discussion
----------

Improved the multiple user providers article

This tries to solve both #8582 and #8611. Please @xabbuh, @chalasr and @ogizanagi tell me if I did what you expected according to your comments in the related issues. Thanks!

Commits
-------

e0f483b Improved the multiple user providers article
@javiereguiluz
Copy link
Member

Fixed by #9726.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hasPR A Pull Request has already been submitted for this issue. Security
Projects
None yet
Development

No branches or pull requests

3 participants