Authenticate to the MPD server
@return bool
163179
public function authenticate() {

                // Check whether the socket is already connected
                if( !$this->connection->established ) {

			// Throw an MPDException along with the connection errors
			throw new MPDException( 'The connection to MPD has not been established', self::MPD_CONNECTION_NOT_ESTABLISHED );
                }

		// Send the connection password
                if( $this->connection->hasPassword() ) {

			// Authenticate to MPD
			if( !$this->password( $this->connection->password )) {

				// We might as well not be connected
				$this->connection->close();

				// If the password fails, then we're not going to be able to do much
				throw new MPDException( 'MPD did not like the provided password', self::MPD_BAD_PASSWORD );
			}

		} else {

			// We might as well not be connected
			$this->connection->close();

			// If we don't have a password, then we're not going to be able to do much
			throw new MPDException( 'Must supply a password to authenticate to MPD', self::MPD_NO_PASSWORD );
		}

		// Password must have been accepted
		return true;
	}
720899
private function verify()
    {
        //====================================================================//
        // Verify host address is present
        if (empty($this->host)) {
            return Splash::log()->err('ErrWsNoHost');
        }

        //====================================================================//
        // Verify Server Id not empty
        if (empty($this->id)) {
            return Splash::log()->err('ErrWsNoId');
        }

        //====================================================================//
        // Verify Server Id not empty
        if (empty($this->key)) {
            return Splash::log()->err('ErrWsNoKey');
        }

        //====================================================================//
        // Verify Http Auth Configuration
        if ($this->httpAuth) {
            if (empty($this->httpUser)) {
                return Splash::log()->err('ErrWsNoHttpUser');
            }
            if (empty($this->httpPassword)) {
                return Splash::log()->err('ErrWsNoHttpPwd');
            }
        }

        return true;
    }
675546
public function authenticateAction()
    {
        if ($this->cmsAuthentication()->hasIdentity()) {
            return $this->redirect()->toRoute($this->options->getLoginRedirectRoute());
        }

        $result = $this->cmsAuthentication()->authenticate();

        // Return early if $result is a response
        if ($result instanceof Response) {
            return $result;
        }

        $redirect = $this->getRedirectParameter();

        if (!$result->isValid()) {
            if ($this->forwardingController) {
                return $this->forward()->dispatch(
                    $this->forwardingController,
                    ['action' => 'login']
                );
            }

            $url = $this->url()->fromRoute(
                $this->options->getLoginRoute(),
                [],
                $redirect ? ['query' => [$this->options->getRedirectKey() => $redirect]] : []
            );

            return $this->redirect()->toUrl($url);
        }

        if ($redirect) {
            return $this->redirect()->toUrl($redirect);
        }

        $route = $this->options->getLoginRedirectRoute();
        if (is_callable($route)) {
            $route = $route($this->cmsAuthentication()->getIdentity());
        }

        return $this->redirect()->toRoute($route);
    }
1074575
private function authenticate()
    {
        $this->requestTimestamp = time();
        $requestData = $this->getDefaultRequestData('json', [
            'userIdentifier' => $this->getUserIdentifier(),
            'userSecret' => $this->getSecretKey()
        ], false);

        return $this->sendRequest('authenticate', $requestData, self::HTTP_METHOD_POST);
    }
1143981
public function authenticate(): bool
    {
        if (!isset($_SERVER['HTTP_AUTHORIZATION'])) {
            $this->logger->debug('skip auth adapter ['.get_class($this).'], no http authorization header found', [
                'category' => get_class($this),
            ]);

            return false;
        }

        $header = $_SERVER['HTTP_AUTHORIZATION'];
        $parts = explode(' ', $header);

        if ('Basic' === $parts[0]) {
            $this->logger->debug('found http basic authorization header', [
                'category' => get_class($this),
            ]);

            $username = $_SERVER['PHP_AUTH_USER'];
            $password = $_SERVER['PHP_AUTH_PW'];

            return $this->plainAuth($username, $password);
        }
        $this->logger->warning('http authorization header contains no basic string or invalid authentication string', [
                'category' => get_class($this),
            ]);

        return false;
    }
1255189
public static function authenticate() {
    // If a client does't support cookies, they can use the X-TILMELDAUTH header
    // to provide the auth token.
    if (!empty($_SERVER['HTTP_X_TILMELDAUTH']) && empty($_COOKIE['TILMELDAUTH'])) {
      $fromAuthHeader = true;
      $authToken = $_SERVER['HTTP_X_TILMELDAUTH'];
    } elseif (!empty($_COOKIE['TILMELDAUTH'])) {
      $fromAuthHeader = false;
      $authToken = $_COOKIE['TILMELDAUTH'];
    } else {
      return false;
    }
    $setupUrlParts = parse_url(self::$config['setup_url']);
    $setupHost = $setupUrlParts['host'].
      (array_key_exists('port', $setupUrlParts) ? ':'.$setupUrlParts['port'] : '');
    if ($_SERVER['HTTP_HOST'] === $setupHost
        && $_SERVER['REQUEST_URI'] === $setupUrlParts['path']
      ) {
      // The request is for the setup app, so don't check for the XSRF token.
      $extract = self::$config['jwt_extract']($authToken);
    } else {
      // The request is for something else, so check for a valid XSRF token.
      if (empty($_SERVER['HTTP_X_XSRF_TOKEN'])) {
        return false;
      }

      $extract = self::$config['jwt_extract'](
          $authToken,
          $_SERVER['HTTP_X_XSRF_TOKEN']
      );
    }

    if (!$extract) {
      self::logout();
      return false;
    }
    $guid = $extract['guid'];
    $expire = $extract['expire'];

    $user = Nymph::getEntity(
        ['class' => '\Tilmeld\Entities\User'],
        ['&',
          'guid' => $guid
        ]
    );
    if (!$user || !$user->guid || !$user->enabled) {
      self::logout();
      return false;
    }

    if ($expire < time() + self::$config['jwt_renew']) {
      // If the user is less than renew time from needing a new token, give them
      // a new one.
      self::login($user, $fromAuthHeader);
    } else {
      self::fillSession($user);
    }
    return true;
  }
159356
private function authenticate()
    {
        $form = new RemoteIdentityForm;
        $form->attributes = array(
            'adapter'  => $this->getUserProfile(),
            'provider' => $this->getProvider()
        );

        return $form->login();
    }
1366444
public function authenticate()
	{
		if (!$this->checkError()) {
			return false;
		}

		try {
			$proxy = $this->getProxy();

			if (!empty($_GET['code'])) {
				// This was a callback request from a service, get the token
				$proxy->requestAccessToken($_GET['code']);
				$this->authenticated = true;
			} else if ($proxy->hasValidAccessToken()) {
				$this->authenticated = true;
			} else {
				/** @var $url Uri */
				$url = $proxy->getAuthorizationUri();
				Yii::$app->getResponse()->redirect($url->getAbsoluteUri())->send();
			}
		} catch (OAuthException $e) {
			throw new ErrorException($e->getMessage(), $e->getCode(), 1, $e->getFile(), $e->getLine(), $e);
		}

		return $this->getIsAuthenticated();
	}
642758
public function authenticate(): bool
    {
        if (isset($_GET['access_token'])) {
            $this->logger->warning('found access_token in query string, you should use a bearer token instead due security reasons https://tools.ietf.org/html/rfc6750#section-2.3', [
                'category' => get_class($this),
            ]);

            return $this->verifyToken($_GET['access_token']);
        }
        if (isset($_SERVER['HTTP_AUTHORIZATION'])) {
            $header = $_SERVER['HTTP_AUTHORIZATION'];
            $parts = explode(' ', $header);

            if ('Bearer' === $parts[0]) {
                $this->logger->debug('found http bearer authorization header', [
                    'category' => get_class($this),
                ]);

                return $this->verifyToken($parts[1]);
            }
            $this->logger->debug('no bearer token provided', [
                    'category' => get_class($this),
                ]);

            return false;
        }

        $this->logger->debug('http authorization header contains no bearer string or invalid authentication string', [
                    'category' => get_class($this),
                ]);

        return false;
    }
839063
protected function login()
    {
        return $this->query('login '.md5(substr($this->read(true), 17) . $this->pwd)) == 'Authentication successful, rcon ready.';
    }
763606
public function authenticate()
    {
        $allowOverride = $this->shardServiceManager->getAllowOverride();
        $this->shardServiceManager->setAllowOverride(true);

        $sysUser = new User;
        $sysUser->addRole('sys::authenticate');
        $this->shardServiceManager->setService('user', $sysUser);
        
        $this->doctrineAdapter->setIdentity($this->identity);
        $this->doctrineAdapter->setCredential($this->credential);
        $result = $this->doctrineAdapter->authenticate();
             
        if ($result->isValid()) {
            $this->shardServiceManager->setService('user', $result->getIdentity());
        } else {
            $sysUser->removeRole('sys::authenticate');
        }
        $this->shardServiceManager->setAllowOverride($allowOverride);
            
        return $result;
    }
377451
protected function authenticate()
    {
        $headers = [
            'Accept: application/json',
            'Content-Type: application/json; charset=utf-8',
        ];

        if (!empty($this->secret_token)) {
            $headers[] = 'X-AppSecretToken:'.$this->secret_token;
        }

        if (!empty($this->grant_token)) {
            $headers[] = 'X-AgreementGrantToken:'.$this->grant_token;
        }

        //default headers
        $options = [
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_SSL_VERIFYPEER => true,
            CURLOPT_HTTPAUTH       => CURLAUTH_BASIC,
            CURLOPT_HTTPHEADER     => $headers,
        ];

        curl_setopt_array($this->ch, $options);
    }
1042182
public function authenticate()
	{
		try {
			$proxy = $this->getProxy();

			if (!empty($_GET['oauth_token'])) {
				$token = $proxy->retrieveAccessToken();

				// This was a callback request, get the token now
				$proxy->requestAccessToken($_GET['oauth_token'], $_GET['oauth_verifier'], $token->getRequestTokenSecret());

				$this->authenticated = true;
			} else if ($proxy->hasValidAccessToken()) {
				$this->authenticated = true;
			} else {
				// extra request needed for oauth1 to request a request token :-)
				$token = $proxy->requestRequestToken();
				/** @var $url Uri */
				$url = $proxy->getAuthorizationUri(['oauth_token' => $token->getRequestToken()]);
				Yii::$app->getResponse()->redirect($url->getAbsoluteUri())->send();
			}
		} catch (OAuthException $e) {
			throw new ErrorException($e->getMessage(), $e->getCode(), 1, $e->getFile(), $e->getLine(), $e);
		}

		return $this->getIsAuthenticated();
	}
294802
public function authenticate()
    {
        $response = $this->client->write(
            sprintf('/auth/userpass/login/%s', $this->username),
            ['password' => $this->password]
        );

        return $response->getAuth();
    }
662105
protected function authenticate()
  {
      $keys = KeyStream::GenerateKeys(base64_decode($this->password), $this->parent->getChallengeData());
      $this->inputKey = new KeyStream($keys[2], $keys[3]);
      $this->outputKey = new KeyStream($keys[0], $keys[1]);
      $array = "\0\0\0\0".$this->phoneNumber.$this->parent->getChallengeData().''.time().'000'.hex2bin('00').'000'.hex2bin('00')
       .Constants::OS_VERSION.hex2bin('00').Constants::MANUFACTURER.hex2bin('00').Constants::DEVICE.hex2bin('00').Constants::BUILD_VERSION;
      $response = $this->outputKey->EncodeMessage($array, 0, 4, strlen($array) - 4);
      $this->parent->setOutputKey($this->outputKey);

      return $response;
  }
45823
public function is_authenticated() {
		$retval = false;
		$parentRes = false;
		
		try {
			if(parent::is_authenticated()) {
				$parentRes = true;
				$retval = $this->is_valid_sid($this->sid);
			}
		}
		catch(Exception $e) {
			$this->exception_handler($e->getMessage());
		}
		
		return ($retval);
	}
863644
public function authenticate()
	{
		$username = $this->input->get('username', false, 'username');
		$password = $this->input->get('password', false, 'raw');

		if (!$username || !$password)
		{
			$this->status = Authentication::NO_CREDENTIALS;

			return false;
		}

		return $this->doAuthenticate($username, $password);
	}