diff --git a/cookbook/security/guard-authentication.rst b/cookbook/security/guard-authentication.rst index b5d6e264e60..d00ba351888 100644 --- a/cookbook/security/guard-authentication.rst +++ b/cookbook/security/guard-authentication.rst @@ -189,12 +189,12 @@ This requires you to implement six methods:: public function getUser($credentials, UserProviderInterface $userProvider) { - $apiToken = $credentials['token']; + $apiKey = $credentials['token']; // if null, authentication will fail // if a User object, checkCredentials() is called return $this->em->getRepository('AppBundle:User') - ->findOneBy(array('apiToken' => $apiToken)); + ->findOneBy(array('apiKey' => $apiKey)); } public function checkCredentials($credentials, UserInterface $user)