Login on Frontoffice & backoffice
| Q | A |
|---|---|
| Bug? | no |
| New Feature? | no |
| Support question? | yes |
| Version | 2.x |
Actual Behavior
I have a frontoffice and a backoffice to my application, some users need to accede to the backoffice. I would like to use hwioauth for both connections (even if the user table is different).
If I connect to the frontoffice, everything works fine. If I connect to the backoffice, I am logged in the frontoffice and not on the front office.
Expected Behavior
Be connected on the backoffice when I try to.
Possible Solutions
If you have already ideas how to solve the issue, add them here. (remove this section if not needed)
@WavaExchange This is not HWIOAuthBundle-specific case but a Symfony Security related question. I think it should be possible with Firewall Contexts: https://symfony.com/doc/current/reference/configuration/security.html#firewall-context but you may need to repeat the oauth configuration for both firewalls though (or use php configuration to keep it DRY).
You may also consider using a single firewall and authorize users based on their permissions, for example ROLE_USER may access the front office only, but ROLE_ADMIN should be able to access back office.
@IonBazan : thx for your reply and your help. I didn't have the time to test it yet but I will let you know in this issue the result of it.
He can return two different user entities from OAuthUserProvider if he already has two different tables for front- and backend users.
Message to comment on stale issues. If none provided, will not mark issues stale
This issue was closed because it has been stalled for 5 days with no activity.