HWIOAuthBundle icon indicating copy to clipboard operation
HWIOAuthBundle copied to clipboard

Login on Frontoffice & backoffice

Open WavaExchange opened this issue 4 years ago • 3 comments

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 avatar Aug 03 '21 10:08 WavaExchange

@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 avatar Aug 16 '21 04:08 IonBazan

@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.

WavaExchange avatar Aug 20 '21 04:08 WavaExchange

He can return two different user entities from OAuthUserProvider if he already has two different tables for front- and backend users.

gassan avatar Aug 27 '21 12:08 gassan

Message to comment on stale issues. If none provided, will not mark issues stale

github-actions[bot] avatar Feb 24 '24 01:02 github-actions[bot]

This issue was closed because it has been stalled for 5 days with no activity.

github-actions[bot] avatar Feb 29 '24 01:02 github-actions[bot]