public function login($identity, $password)
    {
        try {
            $loginStatus = $this->attemptLogin($identity, $password);

            if ($loginStatus) {
                $this->createSuccessfulUserLoginAttempt($identity);
            }

            return $loginStatus;
        } catch (LoginDisabledException $loginDisabledException) {
            $this->createFailedUserLoginAttempt($identity, UserLog::USER_LOG_LOGIN_DISABLED);
            throw $loginDisabledException;
        } catch (LoginExpiredException $loginExpiredException) {
            $this->createFailedUserLoginAttempt($identity, UserLog::USER_LOG_LOGIN_EXPIRED);
            throw $loginExpiredException;
        } catch (LoginTemporarilyLockedOutException $loginDisabledFailedAttemptsException) {
            $this->createFailedUserLoginAttempt($identity, UserLog::USER_LOG_LOGIN_LOCKED);
            throw $loginDisabledFailedAttemptsException;
        } catch (CredentialsFailedException $credentialsFailedException) {
            $this->createFailedUserLoginAttempt($identity, UserLog::USER_LOG_LOGIN_FAILED);
            throw $credentialsFailedException;
        }
    }
public function login($identity, $password)
    {
        try {
            $loginStatus = $this->attemptLogin($identity, $password);

            if ($loginStatus) {
                $this->createSuccessfulUserLoginAttempt($identity);
            }

            return $loginStatus;
        } catch (LoginDisabledException $loginDisabledException) {
            $this->createFailedUserLoginAttempt($identity, UserLog::USER_LOG_LOGIN_DISABLED);
            throw $loginDisabledException;
        } catch (LoginExpiredException $loginExpiredException) {
            $this->createFailedUserLoginAttempt($identity, UserLog::USER_LOG_LOGIN_EXPIRED);
            throw $loginExpiredException;
        } catch (LoginTemporarilyLockedOutException $loginDisabledFailedAttemptsException) {
            $this->createFailedUserLoginAttempt($identity, UserLog::USER_LOG_LOGIN_LOCKED);
            throw $loginDisabledFailedAttemptsException;
        } catch (CredentialsFailedException $credentialsFailedException) {
            $this->createFailedUserLoginAttempt($identity, UserLog::USER_LOG_LOGIN_FAILED);
            throw $credentialsFailedException;
        }
    }
public function login ( $ identity , $ password ) { try { $ loginStatus = $ this -> attemptLogin ( $ identity , $ password ) ; if ( $ loginStatus ) { $ this -> createSuccessfulUserLoginAttempt ( $ identity ) ; } return $ loginStatus ; } catch ( LoginDisabledException $ loginDisabledException ) { $ this -> createFailedUserLoginAttempt ( $ identity , UserLog :: USER_LOG_LOGIN_DISABLED ) ; throw $ loginDisabledException ; } catch ( LoginExpiredException $ loginExpiredException ) { $ this -> createFailedUserLoginAttempt ( $ identity , UserLog :: USER_LOG_LOGIN_EXPIRED ) ; throw $ loginExpiredException ; } catch ( LoginTemporarilyLockedOutException $ loginDisabledFailedAttemptsException ) { $ this -> createFailedUserLoginAttempt ( $ identity , UserLog :: USER_LOG_LOGIN_LOCKED ) ; throw $ loginDisabledFailedAttemptsException ; } catch ( CredentialsFailedException $ credentialsFailedException ) { $ this -> createFailedUserLoginAttempt ( $ identity , UserLog :: USER_LOG_LOGIN_FAILED ) ; throw $ credentialsFailedException ; } }
Attempts to authenticate a user using an identity and a password

@param $identity
@param $password
@return bool
@throws LoginDisabledException
@throws LoginExpiredException
@throws LoginFailedException
@throws LoginTemporarilyLockedOutException
Attempts to authenticate a user using an identity and a password