4
votes

i want to change http_basic to http_digest for a firewall, but it is not really documented how to configure http_digest.

There reference seems to be incomplete or not up to date:

http://symfony.com/doc/2.0/reference/configuration/security.html

http_basic:  
  provider: name  
http_digest:  
  provider: name  

The example in the book however use a realm and no provider.

http://symfony.com/doc/current/book/security.html

http_basic:  
  realm: "Secured Demo Area"  

At least that example works but when i change http_basic to http_digest a (not documented) key is missing.

ErrorException: Notice: Undefined index: key in ..\vendor\symfony\src\Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\HttpDigestFactory.php line 80

http_digest:  
  realm: "Secured Demo Area"  
  key: "whatever"

Adding a key seems to work but after login leads to another error:

Fatal error: Call to undefined method Symfony\Component\Security\Http\EntryPoint\DigestAuthenticationEntryPoint::getKey() in ..\vendor\symfony\src\Symfony\Component\Security\Http\Firewall\DigestAuthenticationListener.php on line 79

Thats the point where i have no clue what is missing in my configuration. I just need a working example for http_digest with Symfony 2.

1
Did you find out ? I'm also interested in this point.Gp2mv3

1 Answers

3
votes

This seems to be resolved in current version of Symfony2 (2.0.10) .

  secured_area:
        pattern:    ^/admin           
        http_digest:
            realm: "Admin"
            key: "thisismykey"

Works for me fine.