Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions cookbook/security/api_key_authentication.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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(
Expand Down Expand Up @@ -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)
{
Expand Down