UserLoaderInterface

interface UserLoaderInterface Represents a class that loads UserInterface objects from Doctrine source for the authentication system. This interface is meant to facilitate the loading of a User from Doctrine source using a custom method. If you want to implement your own logic of retrieving the user from Doctrine your repository should implement this interface. Methods UserInterface|null loadUserByUsername(string $username) Loads the user for the given username. Details

UsernameNotFoundException

class UsernameNotFoundException extends AuthenticationException UsernameNotFoundException is thrown if a User cannot be found by its username. Methods TokenInterface getToken() Get the token. from AuthenticationException setToken(TokenInterface $token) Set the token. from AuthenticationException serialize() unserialize($str) string getMessageKey() Message key to be used by the translation component. array getMessageData() Message data to be used by the translatio

UserCheckerInterface::checkPreAuth()

checkPreAuth(UserInterface $user) Checks the user account before authentication. Parameters UserInterface $user a UserInterface instance Exceptions AccountStatusException

UserInterface::getRoles()

(Role|string)[] getRoles() Returns the roles granted to the user. public function getRoles() { return array('ROLE_USER'); } Alternatively, the roles might be stored on a roles property, and populated in any number of different ways when the user object is created. Return Value (Role|string)[] The user roles

UserInterface::eraseCredentials()

eraseCredentials() Removes sensitive data from the user. This is important if, at any given point, sensitive information like the plain-text password is stored on this object.

UserInterface

interface UserInterface Represents the interface that all user classes must implement. This interface is useful because the authentication layer can deal with the object through its lifecycle, using the object to get the encoded password (for checking against a submitted password), assigning roles and so on. Regardless of how your user are loaded or where they come from (a database, configuration, web service, etc), you will have a class that implements this interface. Objects that implement

UserCheckerInterface::checkPostAuth()

checkPostAuth(UserInterface $user) Checks the user account after authentication. Parameters UserInterface $user a UserInterface instance Exceptions AccountStatusException

UserInterface::getPassword()

string getPassword() Returns the password used to authenticate the user. This should be the encoded password. On authentication, a plain-text password will be salted, encoded, and then compared to this value. Return Value string The password

UserChecker::checkPostAuth()

checkPostAuth(UserInterface $user) Checks the user account after authentication. Parameters UserInterface $user a UserInterface instance

UserCheckerInterface

interface UserCheckerInterface Implement to throw AccountStatusException during the authentication process. Can be used when you want to check the account status, e.g when the account is disabled or blocked. This should not be used to make authentication decisions. Methods checkPreAuth(UserInterface $user) Checks the user account before authentication. checkPostAuth(UserInterface $user) Checks the user account after authentication. Details checkPreAu