Checks to see if the service handles alternative authentication

@return bool
3044
public function handlesAlternateAuth()
    {
        if (
            config('df.alternate_auth') === true &&
            !empty(array_get($this->config, 'alt_auth_db_service_id')) &&
            !empty(array_get($this->config, 'alt_auth_table')) &&
            !empty(array_get($this->config, 'alt_auth_username_field')) &&
            !empty(array_get($this->config, 'alt_auth_password_field')) &&
            !empty(array_get($this->config, 'alt_auth_email_field'))
        ) {
            return true;
        }

        return false;
    }
722364
public function isExternalAuth() {
		$remoteUser = env('REMOTE_USER');
		if (empty($remoteUser)) {
			$remoteUser = env('REDIRECT_REMOTE_USER');
		}

		$result = !empty($remoteUser);

		return $result;
	}
237948
public function getAltAuthenticator()
    {
        if ($this->handlesAlternateAuth()) {
            $authenticator = new AlternateAuth(
                array_get($this->config, 'alt_auth_db_service_id'),
                array_get($this->config, 'alt_auth_table'),
                array_get($this->config, 'alt_auth_username_field'),
                array_get($this->config, 'alt_auth_password_field'),
                array_get($this->config, 'alt_auth_email_field')
            );
            $authenticator->setOtherFields(array_get($this->config, 'alt_auth_other_fields'));
            $authenticator->setFilters(array_get($this->config, 'alt_auth_filter'));

            return $authenticator;
        } else {
            throw new InternalServerErrorException('No alternate authentication is configured for this service.');
        }
    }
928659
public function isAccountingSetup()
  {
    $Setting = $this->Setting->byOrganization($this->AuthenticationManager->getCurrentUserOrganization('id'))->first();

    if(empty($Setting->is_configured))
    {
      return false;
    }
    else
    {
      return true;
    }
  }
51918
public function isAuthenticated()
    {
        $client = parent::getHttpClient();
        if ($client->getClientLoginToken() ||
            $client->getAuthSubToken()
        ) {
            return true;
        }

        return false;
    }
707612
protected function validate()
    {
        // Are needed session variables set ?
        if (!isset($_SESSION['s3ss10nCr3at3d']) || !isset($_SESSION['n3k0t'])) {
            return false;
        }

        // Check if session token match ?
        if ($this->matchUserAgent) {
            if ($_SESSION['n3k0t'] !== hash_hmac($this->hashAlgo, $_SERVER['HTTP_USER_AGENT'] . $_SESSION['s3ss10nCr3at3d'], $this->hashKey)) {
                return false;
            }
        } elseif ($_SESSION['n3k0t'] !== hash_hmac($this->hashAlgo, $_SESSION['s3ss10nCr3at3d'], $this->hashKey)) {
            return false;
        }

        // Is session expired ?
        if ((time() > ($_SESSION['s3ss10nCr3at3d']) + $this->expiration)) {
            return false;
        }

        // Everything is fine return true
        return true;
    }
1353919
protected function _authorize()
	{
		// Check if they are logged in
		if ($this->juser->isGuest())
		{
			return false;
		}

		if ($this->juser->authorise('core.admin', $this->_option))
		{
			return true;
		}

		return false;
	}
1249941
private function isUserTokenAuthenticated()
    {
        try
        {
            $token = $this->TokenUser->getTokenInterface()->get();
            $this->TokenUser->validate($token);
        }
        catch (Exception $exception)
        {
            // We will re-throw this error later if no other authentication types give a successful result
            return $exception;
        }

        return true;
    }
444056
public function checkAuthentication()
    {
        if (self::isAuthenticated()) {
            return true;
        } elseif (self::isGatewayed()) {
            return $this->validateCas();
        }
        self::setGatewayed(true);
        session_write_close();
        $this->redirectToCas(true);
        // never reached
        return true;
    }
137868
public function authentication()
    {
        $response = \Aperdia\Clef::authentication($_GET['code']);

        // error
        if (!$response) {
            $error = 'Error';
        // error
        } elseif (isset($response['error'])) {
            $error = $response['error'];
        // success
        } elseif (isset($response['success'])) {
            // verif if exists account in Authentication table
            $verif = Authentication::whereprovider("clef")->whereprovider_uid($response['info']['id'])->first();

            // no account
            if (empty($verif)) {


            // Find account
            } else {
                // Find the user using the user id
                $user = User::find($verif->user_id);

                // RAZ logout
                if ($user->logout == 1) {
                    $user->logout = 0;
                    $user->save();
                }

                // Log the user in
                Auth::login($user);

                return Redirect::intended('/');
            }
        // error
        } else {
            $error = 'Unknown error';
        }

        return Redirect::to("login")->withErrors($error);
    }
1026715
public function checkAuth() {
        if (isset($_SESSION[$this->_sessionVarName]) &&
            $_SESSION[$this->_sessionVarName] == 1
        ) {
            return true;
        } else {
            return false;
        }
    }
1017944
private function shallAuthenticate()
    {
        $shallAuthenticate = true;
        if ( eZINI::instance( 'rest.ini' )->variable( 'Authentication', 'RequireAuthentication' ) !== 'enabled' )
        {
            $shallAuthenticate = false;
        }
        else
        {
            $routeFilter = ezpRestRouteFilterInterface::getRouteFilter();
            $shallAuthenticate = $routeFilter->shallDoActionWithRoute( $this->info );
        }

        return $shallAuthenticate;
    }
54818
protected function passesAuthorization(): bool
    {
        $passes = false;

        if (\method_exists($this, 'authorize')) {
            $passes = $this->container->call([$this, 'authorize']);
        }

        return (bool) $passes;
    }
42832
final public function isAuthenticated()
    {

        $self = $this;
        $auth = $self->get("handler", "auth");

        if (is_a($auth, Authenticate::class)) {
            if (isset($auth->authenticated)) {
                return (bool)$auth->authenticated;
            }
        }

        return false;
    }
248070
public function authenticate()
    {
        $hmac = $this->getRest()->getServer()->getHmac();
        $data = array_merge($this->getRequestHeaders(true), $this->getBodyData());
        $auth = $hmac->setData($data)
                     ->setRoute($this->getPlatform()->getPost('api_method'))
                     ->setMethod($_SERVER['REQUEST_METHOD'])
                     ->auth($this->settings['api_key'], $this->settings['api_secret']);
        
        if(!$auth) {
            return false;
        }
        
        return true;
    }
1066379
public function checkRegistryRequestsAnswers()
    {
        if ($this->_gemsData) {
            if ($this->currentUser instanceof \Gems_User_User) {
                $this->_gemsData = $this->currentUser->applyGroupMask($this->_gemsData);
            }
        } else {
            if ($this->db instanceof \Zend_Db_Adapter_Abstract) {
                $this->refresh();
            } else {
                return false;
            }
        }

        return $this->exists;
    }
777065
public static function isAuthorized()
    {
        $headers = apache_request_headers();
        if (isset($_SESSION['uid'])) {
            return true;
        }
        if(!isset($headers['N5-Api-Sig']))
            return FALSE;
        $salt = "N@t1v3";
        $request_sig = $headers['N5-Api-Sig'];
        $string = $headers['N5-Api-Key'].$salt;
        if(hash('sha256', $string) == $request_sig)
            return TRUE;
        return FALSE;	
    }