Skip to content

Latest commit

 

History

History
50 lines (39 loc) · 1.87 KB

README.md

File metadata and controls

50 lines (39 loc) · 1.87 KB

SwitchUserStatelessBundle

Scrutinizer Code Quality Code Coverage Build Status Dependency Status SensioLabsInsight

This bundle provides impersonating feature (switch user) for API use.

Install this bundle through Composer:

composer require lafourchette/switch-user-stateless-bundle

Then, update your AppKernel.php file as following:

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = [
            // ...
            new SwitchUserStatelessBundle\SwitchUserStatelessBundle(),
        ];

Load routing in app/config/routing.yml:

switch_user_stateless:
    resource: "@SwitchUserStatelessBundle/Controller/ProfileController.php"
    type: annotation

Finally, update your firewalls in your app/config/security.yml file as following:

security:
    firewalls:
        main:
            # ...
            stateless: true
            switch_user_stateless: true

Read the complete doc