1
votes

I use FosUserBundle for the login/register actions

I want to have two or more User table as User, BackUser, ...

I need also two different firewalls:

firewalls:
    back:
        pattern:  ^/back
        form_login:
            provider: fos_BackUser
            csrf_provider: form.csrf_provider
            login_path: /back/login
            check_path: /back/login_check
        logout:
            path:       /back/logout
            target:     /back
        anonymous:  true
    main:
        pattern:  ^/
        form_login:
            provider: fos_User
            csrf_provider: form.csrf_provider
        logout:     true
        anonymous:  true

But with FosUserBundle I cannot set two differents providers.

I found this on google: https://groups.google.com/group/symfony2/browse_thread/thread/17d3fb94a1e305f8/e5ef7243cd84b558?lnk=raot

the first solution look good for my needs but I cannot make it work.

Any ideas?

1
"I want to have two or more User table as User, BackUser, ..." That is either table inheritance, or roles. I assume "roles".KingCrunch
No I want to have two different table each can have roles But a "BackUser" is not suppose to connect in the Front.user1014102
What are the reasons why you can't just use one table for users, use and table inheritance or roles to separate front and back users? This is the common method to do what you want.Hakan Deryal
My specs says that I need to separate User and BackUser. Like they don't want a big table for all users and the user can access the back or not. They want it as if there is two site. Then a BackUser can login into the Front as a client maybe with the FosOAuthServerBundleuser1014102

1 Answers

1
votes

You should take a look at https://github.com/leopro/PUGXMultiUserSandbox This is a kind of "extension" for FOSUserBundle that allows you to have multiple user types. Hope that's what you're looking for !