[Security] Check post_only option and request method

This commit is contained in:
Henrik Bjørnskov 2012-06-09 13:28:23 +02:00
parent b84b46ba1a
commit 6a01d3dd54
1 changed files with 12 additions and 0 deletions

View File

@ -50,6 +50,18 @@ class UsernamePasswordFormAuthenticationListener extends AbstractAuthenticationL
$this->csrfProvider = $csrfProvider;
}
/**
* @{inheritdoc}
*/
protected function requiresAuthentication(Request $request)
{
if ($this->options['post_only'] && !$request->isMethod('post')) {
return false;
}
return parent::requiresAuthentication($request);
}
/**
* {@inheritdoc}
*/