protected function addFirewall(Application $app, $pattern, $authType)
    {
        $firewalls = $app['security.firewalls'];
        $key = is_object($pattern) ? spl_object_hash($pattern) : $pattern;
        $firewalls[$key] =  [
            'pattern' => $pattern,
            $authType => true,
        ];

        $app['security.firewalls'] = $firewalls;
    }