0

I have a security.yml like a:

security:  
  firewalls:    
    first_area:  
      pattern: ^/someStr  
      ********  
    second_area:  
      pattern: ^/otherStr  
      ********  

And I can login to user in the same firewall section, but I can't login to user in the other firewall section. I do it like this:

$token = new UsernamePasswordToken(user, null, 'second_area', userRoles);  
$security->setToken($token);
4

1 回答 1

0

共享上下文比在会话中手动存储令牌更正确:http: //symfony.com/doc/current/reference/configuration/security.html#reference-security-firewall-context

于 2014-04-22T15:35:05.133 回答