Initializes the Twitter Authentication process. Will redirect to twitter for the user to login, setting the oauth callback url to this controllers authenticate method.

@return void
@throws Exception
553298
public function loginAction() {
		$uri = new \TYPO3\Flow\Http\Uri('https://api.twitter.com/oauth/request_token');
		$request = \TYPO3\Flow\Http\Request::create($uri, 'POST');
		$request->setContent('');
		$callbackUri = $this->uriBuilder->reset()->setCreateAbsoluteUri(TRUE)->uriFor('authenticate', array(), $this->request->getControllerName(), $this->request->getControllerPackageKey(), $this->request->getControllerSubpackageKey());
		$request = $this->requestSignatureGenerator->signRequest($request, $callbackUri);

		$response = $this->client->sendRequest($request);
		$responseData = array();
		parse_str($response->getContent(), $responseData);
		if ($response->getStatusCode() !== 200 || !isset($responseData['oauth_callback_confirmed']) || $responseData['oauth_callback_confirmed'] !== 'true') {
			throw new Exception($response->getStatus(), 1426084485);
		}

		$this->requestSignatureGenerator->setTokenData($responseData['oauth_token'], $responseData['oauth_token_secret']);

		$this->redirectToUri('https://api.twitter.com/oauth/authenticate?oauth_token=' . $responseData['oauth_token'], 0, 302);
	}
849571
public function initialize()
    {
        if ( ! isset($this->authenticator)) {
            throw new \RuntimeException('Aegis is missing an authentication authenticator.');
        }

        if ( ! isset($this->storage)) {
            throw new \RuntimeException('Aegis is missing a persistent storage engine.');
        }

        // Set inital token to be anonymous until proven otherwise
        $this->setToken(new AnonymousToken());

        // Attempt to read token from persistent storage
        $token = $this->storage->read();

        // Re-authenticate stored token
        if ($token instanceof TokenInterface) {
            $result = $this->authenticate($token);
        }

        $this->initialized = true;

        return $this;
    }
793017
protected function performInit()
    {
        $this->prepareTargetRoute()
             ->prepareParentParameter()
             ->checkForMorphToRelation();


        // Check permissions
        $permissions = $this->actionData->permissions();

        if (empty($permissions)) {
            $this->isPermitted = true;
        } else {
            $this->isPermitted = cms_auth()->can($permissions);
        }
    }
531363
protected function initialize()
    {
        $this->url = '';
        $this->options = [];
        $this->secure = array_get($this->config, 'secure', true);
        $this->retryOn = array_get($this->config, 'retry.on', [500, 502, 503, 504]);
        $this->retryDelay = array_get($this->config, 'retry.delay', 10);
        $this->retry = array_get($this->config, 'retry.times', 5);
        $this->verify = array_get($this->config, 'verify', true);
        $this->async = array_get($this->config, 'async', false);
    }
1107918
public function init($options = [])
    {
        $auth = new Authentication();

        if (!$auth->check()) {
            $url = (isset($options['auth_login_url']))
            ? $options['auth_login_url']
            : '/auth/login';

            $this->redirect = $url;
        }
    }
913730
public function init()
    {
        try {
            $this->header('Content-Type: text/html');
        } catch (\Exception $e) {
        }

        $this->appInstance->httpclient->get(
            'http://www.google.com/robots.txt',
            function ($conn, $success) {
                echo $conn->body;
                $this->finish();
            }
        );

        // setting timeout
        $this->sleep(5, true);
    }
711841
protected function _auth()
    {
        if (isset($this->_config['username'], $this->_config['password'])) {
            $replyCode = (string)$this->_smtpSend('AUTH LOGIN', '334|500|502|504');
            if ($replyCode === '334') {
                try {
                    $this->_smtpSend(base64_encode($this->_config['username']), '334');
                } catch (SocketException $e) {
                    throw new SocketException('SMTP server did not accept the username.', null, $e);
                }
                try {
                    $this->_smtpSend(base64_encode($this->_config['password']), '235');
                } catch (SocketException $e) {
                    throw new SocketException('SMTP server did not accept the password.', null, $e);
                }
            } elseif ($replyCode === '504') {
                throw new SocketException('SMTP authentication method not allowed, check if SMTP server requires TLS.');
            } else {
                throw new SocketException('AUTH command not recognized or not implemented, SMTP server may not require authentication.');
            }
        }
    }
1195971
public function startup()
    {
        if (!$this->getConfig('requireIdentity')) {
            return;
        }

        $request = $this->getController()->request;
        $action = $request->getParam('action');
        if (in_array($action, $this->unauthenticatedActions)) {
            return;
        }

        $identity = $request->getAttribute($this->getConfig('identityAttribute'));
        if (!$identity) {
            throw new UnauthenticatedException();
        }
    }
137952
protected function initClient()
    {
        //get slack config
        $slack_config = config('slack-output');

        if (empty( $slack_config["endpoint"] )) {
            throw new Exception("The endpoint url is not set in the config");
        }

        //init client
        $this->client = new Client($slack_config["endpoint"], [
            "username" => $slack_config["username"],
            "icon"     => $slack_config["icon"]
        ]);
    }
327278
public function run()
    {
        $this->tryAssignController();
        if (!$this->isControllerAssigned()) {
            throw new Exception("It's unable to assign controller to this route path.");
        }
        $oCtrl = $this->createCtrl();
        $oCtrl->{$this->actionName}($this->actionArgs);
    }
472272
public function setupAuthentication() {
		if (!in_array('Auth', $this->components()->loaded())) {
			$this->components()->load('Auth');
		}

		$this->components()->Auth->setConfig('authenticate', [
			'Form' => [
				'userModel' => 'Users',
				'fields' => [
					'username' => 'email',
					'password' => 'password'
				],
				'scope' => [
					'Users.email_verified' => 1
				]
			]
		]);
	}
63347
private static function initialize()
    {
        if (self::$initialized) return;

        self::$client = \OpenId::getClient();
        self::$version = config('openid.api-version');
        self::$initialized = TRUE;
    }
1318697
public function init()
    {
        parent::init();

        $this->authManager = Instance::ensure($this->authManager, DbManager::className());
    }
92515
public void start()
        throws Exception
    {
        if (getHttpContext().getAuthenticator()==null)
        {
            // Find out the Authenticator.
            if (SecurityConstraint.__BASIC_AUTH.equalsIgnoreCase(_authMethod))
                getHttpContext().setAuthenticator(new BasicAuthenticator());
            else if (SecurityConstraint.__CERT_AUTH.equalsIgnoreCase(_authMethod))
                getHttpContext().setAuthenticator(new ClientCertAuthenticator());
            else
                log.warn("Unknown Authentication method:"+_authMethod);
        }
        
        super.start();
    }
216047
public function Init()
    {
        $oGlobal = TGlobal::instance();
        $this->aUserInput = $oGlobal->GetUserData('aInput');
        if (!is_array($this->aUserInput)) {
            $this->aUserInput = array();
        }

        if (!array_key_exists(MTShopArticleCatalogCore::URL_ITEM_ID, $this->aUserInput)) {
            $oGlobal = TGlobal::instance();
            $this->aUserInput[MTShopArticleCatalogCore::URL_ITEM_ID] = $oGlobal->GetUserData(MTShopArticleCatalogCore::URL_ITEM_ID);
        }

        $aInitInputData = array('name', 'email', 'toname', 'toemail', 'comment', 'captcha');
        foreach ($aInitInputData as $sField) {
            if (!array_key_exists($sField, $this->aUserInput)) {
                $this->aUserInput[$sField] = '';
            }
        }
        $this->aUserInput = $this->FilterUserData($this->aUserInput);
    }
1119601
protected function onInit()
    {
        $host = Util::get($this->params, "host", "");//host\instanceName
        $username = Util::get($this->params, "username", "");
        $password = Util::get($this->params, "password", "");
        $dbname = Util::get($this->params, "dbname", "");
        $connString = "host=$host dbname=$dbname user=$username password=$password";
        
        $key = md5($connString);

        if (isset(PostgreSQLDataSource::$connections[$key])) {
            $this->connection = PostgreSQLDataSource::$connections[$key];
        } else {
            $conn = pg_connect($connString);
            if ($conn) {
                $this->connection = $conn;
            } else {
                throw new \Exception("Could not connect to database");
            }
            PostgreSQLDataSource::$connections[$key] = $this->connection;
        }
        
    }
1211173
public function run() {
		if ($this->url === null) {
			throw new \Exception("No URL configured for redirection.");
		}
		if (strpos($this->url, '/') === 0 || strpos($this->url, 'http://') === 0 || strpos($this->url, 'https://') === 0) {
			$url = ValueUtils::val($this->url);
		} else {
			$url = ROOT_URL.ValueUtils::val($this->url);
		}
		header("Location: ".$url);
	}