2011-08-26 117 views
4

我想將http_basic更改爲防火牆的http_digest, 但它沒有真正記錄如何配置http_digest。需要Symfony2 http_digest防火牆配置示例

有參考似乎不完整或不及時更新:

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

http_basic: 
    provider: name 
http_digest: 
    provider: name 

書中的例子卻用一種境界,沒有供應商。

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

http_basic: 
    realm: "Secured Demo Area" 

至少,例如工作,但是當我改變http_basic到http_digest一個(未記載)密鑰丟失。

ErrorException:注意:未定義指數:在關鍵.. \供應商\ symfony中的\ src \的Symfony \包\ SecurityBundle \ DependencyInjection \安全\廠\ HttpDigestFactory.php線80

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

添加一個關鍵似乎但在登錄後導致另一個錯誤:

致命錯誤:調用未定義的方法Symfony \ Component \ Security \ Http \ EntryPoint \ DigestAuthenticationEntryPoint :: getKey()in .. \ vendor \ symfony \ src \ Symfony \ Component \ Security \ Http \ Firewall \ DigestAuthenticationListener.php on line 79

這就是我不知道我的配置中缺少什麼的點。 我只需要一個用於Symfony 2的http_digest的工作示例。

+0

您發現了嗎?我對這一點也很感興趣。 – Gp2mv3

回答

3

這似乎是在當前版本的Symfony2(2.0.10)中解決的。

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

對我來說很好。