LoginService
class LoginService implements LoggerAwareInterface, ApplicationAwareInterface (View source)
Traits
Trait LoggerAwareTrait A trait used with LoggerAwareInterface
Trait ApplicationAwareTrait A trait used with ApplicationAwareInterface
Properties
protected Application | $app | from ApplicationAwareTrait | |
protected Repository | $config | The config repository we use to format errors appropriately |
|
protected LoginAttemptService | $loginAttemptService | This service tracks login attempts and deals with excessive attempts |
|
protected string deprecated | $userClass | The class to use when testing login credentials. |
|
protected IPService | $ipService | This service tracks login attempts against IPs and deals with excessive attempts from specific IPs |
|
protected EntityManagerInterface|null | $entityManager | The entity manager to use to find out more information about a login attempt |
|
protected Request|null | $request | The request instance |
Methods
Get the logger channel expected by this LoggerAwareTrait implementation The user is expected to declare this method and return a valid channel name.
No description
Force log in as a specific user ID This method will setup session and set a cookie
Handle a failed login attempt
Add a log entry for this login attempt
Aggregate a list of groups to report
Throw an exception based on the given error number
Change the user class used to validate the given credentials
Details
getLoggerChannel()
Get the logger channel expected by this LoggerAwareTrait implementation The user is expected to declare this method and return a valid channel name.
setApplication(Application $app)
Setter method for the application
__construct(Repository $config, LoginAttemptService $loginAttemptService, IPService $IPService, EntityManagerInterface $entityManager = null, Request $request = null)
No description
User
login(string $username, string $password)
Attempt login given a username and a password
User
loginByUserID(int $userId)
Force log in as a specific user ID This method will setup session and set a cookie
failLogin(string $username, string $password)
Handle a failed login attempt
logLoginAttempt($username, array $errors = [])
Add a log entry for this login attempt
private array
getGroups($username)
Aggregate a list of groups to report
protected
handleUserError(int $errorNum)
Throw an exception based on the given error number
setUserClass(string $userClass)
deprecated
deprecated
Change the user class used to validate the given credentials