Skip to content

Commit 5704906

Browse files
Update guard_authentication.rst
See #13418 (comment)
1 parent 3721b9c commit 5704906

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

security/guard_authentication.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,10 @@ This requires you to implement several methods::
165165
return null;
166166
}
167167

168-
// if a User is returned, checkCredentials() is called
169-
return $this->em->getRepository(User::class)
170-
->findOneBy(['apiToken' => $credentials])
171-
;
168+
// The "username" in this case is the apiToken, see the key `property`
169+
// of `your_db_provider` in `security.yaml`.
170+
// If this returns a user, checkCredentials() is called next:
171+
return $userProvider->loadUserByUsername($apiToken);
172172
}
173173

174174
public function checkCredentials($credentials, UserInterface $user)

0 commit comments

Comments
 (0)