From 064c74040e0b82e33bbcb4e2d176d5d8f495b085 Mon Sep 17 00:00:00 2001 From: Robin van der Vleuten Date: Mon, 27 Jan 2014 15:05:17 +0100 Subject: [PATCH 1/3] Fixed small typo in code example --- cookbook/security/api_key_authentication.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cookbook/security/api_key_authentication.rst b/cookbook/security/api_key_authentication.rst index cd2812ebd88..99886a4d003 100644 --- a/cookbook/security/api_key_authentication.rst +++ b/cookbook/security/api_key_authentication.rst @@ -59,7 +59,7 @@ value and then a User object is created:: public function authenticateToken(TokenInterface $token, UserProviderInterface $userProvider, $providerKey) { $apiKey = $token->getCredentials(); - $username = $this->userProvider->getUsernameForApiKey($apiKey) + $username = $this->userProvider->getUsernameForApiKey($apiKey); if (!$username) { throw new AuthenticationException( From ea5531b4f9b1d72ba52fca9cf6cdfa41557c6ede Mon Sep 17 00:00:00 2001 From: Robin van der Vleuten Date: Mon, 27 Jan 2014 15:11:28 +0100 Subject: [PATCH 2/3] An interface should be implemented --- cookbook/security/api_key_authentication.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cookbook/security/api_key_authentication.rst b/cookbook/security/api_key_authentication.rst index 99886a4d003..dd7003ddb68 100644 --- a/cookbook/security/api_key_authentication.rst +++ b/cookbook/security/api_key_authentication.rst @@ -145,7 +145,7 @@ The ``$userProvider`` might look something like this:: use Symfony\Component\Security\Core\User\UserInterface; use Symfony\Component\Security\Core\Exception\UnsupportedUserException; - class ApiKeyUserProvider extends UserProviderInterface + class ApiKeyUserProvider implements UserProviderInterface { public function getUsernameForApiKey($apiKey) { From 0c6cfd113ba6328b8d526e4ca886bd3ce324e4a2 Mon Sep 17 00:00:00 2001 From: Robin van der Vleuten Date: Mon, 27 Jan 2014 15:12:54 +0100 Subject: [PATCH 3/3] Example creates a class not an interface --- cookbook/security/api_key_authentication.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cookbook/security/api_key_authentication.rst b/cookbook/security/api_key_authentication.rst index dd7003ddb68..3e245e520b4 100644 --- a/cookbook/security/api_key_authentication.rst +++ b/cookbook/security/api_key_authentication.rst @@ -38,7 +38,7 @@ value and then a User object is created:: { protected $userProvider; - public function __construct(ApiKeyUserProviderInterface $userProvider) + public function __construct(ApiKeyUserProvider $userProvider) { $this->userProvider = $userProvider; }