Get CSRF Token.

@return string|null
431460
protected function getCsrfToken(): ?string
    {
        if (is_null($this->csrfToken)) {
            $this->csrfToken = $this->app->make('session')->token();
        }

        return $this->csrfToken;
    }
7619
public function getCSRFCookie()
	{
		$cookie = $this->_browserInterface->getCookie($this->_csrf_cookiename);
		if ( !$cookie )
			throw new SecureRequestHelper\CSRFException('CSRF cookie has not been initialized');
		
		return $cookie;
	}
1317699
protected function getToken() {
    // Iterate over the supported tokens to find the token in the tokenized
    // path.
    foreach (array_keys($this->supportedTokens) as $token_name) {
      if (strpos($this->path, $token_name) !== FALSE) {
        return $token_name;
      }
    }
    return NULL;
  }
1193827
public static function getStoredToken(): Token
    {
        if (static::$token !== null) {
            return static::$token;
        }

        $sessionKeyName = static::getSessionKeyName();

        if ($sessionKeyName === null || strlen($sessionKeyName) == 0) {
            throw new Exception('Can not get stored CSRF token when session key is not set');
        }

        $token = Session::get($sessionKeyName);

        if ($token === null) {
            throw new SecurityException('There is no stored token on backend');
        }

        static::$token = $token;
        return $token;
    }
719022
public function getClientToken()
    {
        $client = app('db')->connection()->table('clients')
            ->where('client_id', config('services.northstar.client_credentials.client_id'))
            ->first();

        // If any of the required fields are empty, return null.
        if (empty($client->access_token) || empty($client->access_token_expiration)) {
            return null;
        }

        return new AccessToken([
            'access_token' => $client->access_token,
            'expires' => $client->access_token_expiration,
        ]);
    }
944005
public function getNewToken()
    {
        $post = array(
            'auth' => array(
                'username' => $this->username,
                'password' => $this->password,
            ),
        );
        return $this->http->call(HttpMethod::POST, $this->host.'/auth', $post)->token;
    }
241703
public function getRequestToken()
    {
        $token = false;

        foreach ($this->sources as $source) {
            if (($token = $source->getRequestToken()) !== false) {
                break;
            }
        }

        return $token;
    }
121482
public function getCookie()
    {
        $request = Request::current();
        $settings = CsrfSettings::singleton();

        if ($request instanceof WebRequest){
            $existingCookie = $request->cookie(self::TOKEN_COOKIE_NAME, false);

            if ($existingCookie){
                $this->currentCookie = $existingCookie;
            }
        }

        if (!$this->currentCookie) {
            $chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ012345689.;,!$%^&*()-=+";
            $cookie = "";
            for ($x = 0; $x < self::TOKEN_COOKIE_LENGTH; $x++) {
                $rand = rand(0, strlen($chars) - 1);
                $char = $chars[$rand];

                if (rand(0, 1) == 1) {
                    $char = strtolower($char);
                }

                $cookie .= $char;
            }

            $this->currentCookie = $cookie;

            HttpResponse::setCookie(self::TOKEN_COOKIE_NAME, $cookie, 0, '/', parse_url($settings->domain, PHP_URL_HOST), false, true);
        }

        return $this->currentCookie;
    }
37563
public function getToken()
    {

        $request = new Request();

        if ($request->isPost() === true) {
            $this->token = $request->getPost('token', null, false);
        } else {
            $this->token = $request->getQuery('token', null, false);
        }

        return $this->token;
    }
153341
function getToken()
    {
        if (! $this->token )
            $this->token = $this->exchangeToken();
        elseif (\Poirot\OAuth2Client\checkExpiry( $this->token->getDateTimeExpiration() ))
            $this->token = $this->exchangeToken();


        return $this->token;
    }
682406
public function getToken()
    {
        if(!isset($this->__token))
        {
            $token   = false;
            $request = $this->getObject('request');

            if($request->headers->has('X-XSRF-Token')) {
                $token = $request->headers->get('X-XSRF-Token');
            }

            if($request->headers->has('X-CSRF-Token')) {
                $token = $request->headers->get('X-CSRF-Token');
            }

            if($request->data->has('csrf_token')) {
                $token = $request->data->get('csrf_token', 'sha1');
            }

            $this->__token = $token;
        }

        return $this->__token;
    }
779781
public function token()
    {
        if (empty($this->csrfToken) && !is_null($this->session)) {
            $this->csrfToken = $this->session->token();
        }

        return $this->hidden('_token', $this->csrfToken);
    }
595557
protected function getTokenForRequest()
	{
		$token = $this->request->input( $this->inputKey );

		if ( empty( $token ) )
			$token = $this->request->bearerToken();

		if ( empty( $token ) )
			$token = $this->request->getPassword();

		return $token;
	}
394425
public function getToken()
    {
        if ($this->csrfToken != '') {
            return $this->csrfToken;
        }

        $this->csrfToken = wp_generate_password(64, false);

        $this->session->set('tiga_csrf_token', $this->csrfToken);

        return $this->csrfToken;
    }
1090491
protected function getTokenFromServer()
    {
        $http = new Http();
        $params = array(
            'corpid'      => $this->appId,
            'corpsecret'     => $this->appSecret,
        );

        $token = $http->get(self::API_TOKEN_GET, $params);

        return $token;
    }
840394
public function getToken()
    {
        if(isset($this->_tokens[$this->_position])) {
            return $this->_tokens[$this->_position];
        } else {
            return null;
        }
    }
1254875
private function getProvidedCsrfToken(): ?string
    {
        $token = $this->request->getParameter(self::REQUEST_TOKEN_VALUE);
        if (is_null($token)) {
            $token = isset($_SERVER[self::HEADER_TOKEN]) ? $_SERVER[self::HEADER_TOKEN] : null;
        }
        return $token;
    }