[Security] remove deprecated HTTP digest auth key
This commit is contained in:
parent
743e670f4a
commit
812396d6c6
@ -58,22 +58,6 @@ class HttpDigestFactory implements SecurityFactoryInterface
|
|||||||
public function addConfiguration(NodeDefinition $node)
|
public function addConfiguration(NodeDefinition $node)
|
||||||
{
|
{
|
||||||
$node
|
$node
|
||||||
->beforeNormalization()
|
|
||||||
->ifTrue(function ($v) { return isset($v['key']); })
|
|
||||||
->then(function ($v) {
|
|
||||||
if (isset($v['secret'])) {
|
|
||||||
throw new \LogicException('Cannot set both key and secret options for http_digest, use only secret instead.');
|
|
||||||
}
|
|
||||||
|
|
||||||
@trigger_error('http_digest.key is deprecated since version 2.8 and will be removed in 3.0. Use http_digest.secret instead.', E_USER_DEPRECATED);
|
|
||||||
|
|
||||||
$v['secret'] = $v['key'];
|
|
||||||
|
|
||||||
unset($v['key']);
|
|
||||||
|
|
||||||
return $v;
|
|
||||||
})
|
|
||||||
->end()
|
|
||||||
->children()
|
->children()
|
||||||
->scalarNode('provider')->end()
|
->scalarNode('provider')->end()
|
||||||
->scalarNode('realm')->defaultValue('Secured Area')->end()
|
->scalarNode('realm')->defaultValue('Secured Area')->end()
|
||||||
|
@ -64,16 +64,6 @@ class DigestAuthenticationEntryPoint implements AuthenticationEntryPointInterfac
|
|||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated Since version 2.8, to be removed in 3.0. Use getSecret() instead.
|
|
||||||
*/
|
|
||||||
public function getKey()
|
|
||||||
{
|
|
||||||
@trigger_error(__method__.'() is deprecated since version 2.8 and will be removed in 3.0. Use getSecret() instead.', E_USER_DEPRECATED);
|
|
||||||
|
|
||||||
return $this->getSecret();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
|
@ -78,7 +78,7 @@ class DigestAuthenticationListener implements ListenerInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$digestAuth->validateAndDecode($this->authenticationEntryPoint->getKey(), $this->authenticationEntryPoint->getRealmName());
|
$digestAuth->validateAndDecode($this->authenticationEntryPoint->getSecret(), $this->authenticationEntryPoint->getRealmName());
|
||||||
} catch (BadCredentialsException $e) {
|
} catch (BadCredentialsException $e) {
|
||||||
$this->fail($event, $request, $e);
|
$this->fail($event, $request, $e);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user