Sets CSRF value and returns the login URL.

@param array $options

@return string

@see League\OAuth2\Client\Provider\AbstractProvider::getAuthorizationUrl()
192404
public function getLoginUrl(array $options = [])
    {
        $url = $this->provider->getAuthorizationUrl($options);
        $this->store->set('oauth2state', $this->provider->getState());
        return $url;
    }
451171
protected function initRequest($url, $options = array()) {
		$ch = parent::initRequest($url, $options);
		curl_setopt($ch, CURLOPT_USERAGENT, 'yii-eauth extension');
		return $ch;
	}
1143302
function getAuthorizeURL($token, $sign_in_with_twitter = TRUE)
    {
        if (is_array($token)) {
            $token = $token['oauth_token'];
        }
        if (empty($sign_in_with_twitter)) {
            return $this->authorizeURL() . "?oauth_token={$token}";
        } else {
            return $this->authenticateURL() . "?oauth_token={$token}";
        }
    }
340598
protected static function getAction(array $options)
    {
        //check if action is URL
        if (array_has($options, 'url')) {
            return 'http://'.array_get($options, 'url');
        }

        //check if action is secure for HTTPS
        if (array_has($options, 'secure')) {
            return 'https://'.array_get($options, 'secure');
        }

        //check if action is route
        if (array_has($options, 'route')) {
            return path().array_get($options, 'route');
        }
    }
108006
public function getUrl(UrlOptionsInterface $options = \null): string
    {
        $query = \null !== $options ? '?'.$options->getQueryString() : '';

        return parent::getUrl().$query;
    }
678149
public function getAuthorizeUrl($token, $sign_in_with_twitter = true, $force_login = false)
    {
        if (is_array($token)) {
            $token = $token['oauth_token'];
        }
        if ($force_login) {
            return "https://api.twitter.com/oauth/authenticate?oauth_token={$token}&force_login=true";
        } elseif (empty($sign_in_with_twitter)) {
            return "https://api.twitter.com/oauth/authorize?oauth_token={$token}";
        } else {
            return "https://api.twitter.com/oauth/authenticate?oauth_token={$token}";
        }
    }
989495
public function auth(array $options = [])
    {
        // Authentication routes.
        $this->get('auth/login', 'Auth\LoginController@showLoginForm')->name('login');
        $this->post('auth/login', 'Auth\LoginController@login');
        $this->post('auth/logout', 'Auth\LoginController@logout')->name('logout');

        // Registration routes.
        if ($options['register'] ?? true) {
            $this->get('auth/register', 'Auth\RegisterController@showRegistrationForm')->name('register');
            $this->post('auth/register', 'Auth\RegisterController@register');
        }

        // Password reset routes.
        if ($options['reset'] ?? true) {
            $this->resetPassword();
        }

        // Email verifications routes.
        if ($options['verify'] ?? false) {
            $this->emailVerification();
        }
    }
1367198
public function getAuthorizeUrl($api_settings = '',
                                    $callback_url = 'https://api.vk.com/blank.html', $test_mode = false)
    {
        $parameters = array(
            'client_id' => $this->app_id,
            'scope' => $api_settings,
            'redirect_uri' => $callback_url,
            'response_type' => 'code'
        );

        if ($test_mode)
            $parameters['test_mode'] = 1;

        return $this->createUrl(self::AUTHORIZE_URL, $parameters);
    }
87488
public function getAccessToken($grant, array $options = [])
    {
        $grant = $this->verifyGrant($grant);

        $params = [
            'client_id'     => $this->clientId,
            'client_secret' => $this->clientSecret,
            'redirect_uri'  => $this->redirectUri,
        ];

        $params   = $grant->prepareRequestParameters($params, $options);
        $request  = $this->getAccessTokenRequest($params);
        $response = $this->getParsedResponse($request);
        if (false === is_array($response)) {
            throw new UnexpectedValueException(
                'Invalid response received from Authorization Server. Expected JSON.'
            );
        }
        $prepared = $this->prepareAccessTokenResponse($response);
        $token    = $this->createAccessToken($prepared, $grant);

        return $token;
    }
103617
public function getIdFromOptions(array $options) : string
    {
        $optionsResolver = new OptionsResolver();
        $optionsResolver->setRequired('id');

        $options = $optionsResolver->resolve($options);

        return $options['id'];
    }
531991
public function request($method, $url, $token, array $options = [])
    {
        $request = $this->getAuthenticatedRequest(
            $method, $url, $token, $options
        );

        return $this->getResponse($request);
    }
846513
protected function getUrl(array $options): string
    {
        $urlOptions = [];
        $this->setOriginAndDestinationOption($urlOptions, $options);
        $this->setViaOption($urlOptions, $options);
        $this->setDateOption($urlOptions, $options);

        $urlOptions = array_merge($urlOptions, $options);

        return sprintf('trip?%s&format=json', http_build_query($urlOptions));
    }
1226520
public function getSessionToken($options = array())
    {
        list($config, $acl, $durationSeconds) =
            $this->parseOptions(
                $options,
                'config',
                'acl',
                'durationSeconds'
            );
		
        $params = array();
        if ($durationSeconds !== null) {
            $params['durationSeconds'] = $durationSeconds;
        }
        $headers = array();
        if ($acl !== null) {
            $headers[HttpHeaders::CONTENT_LENGTH] = strlen($acl);
        } else {
            $headers[HttpHeaders::CONTENT_LENGTH] = 0;
        }
        $headers[HttpHeaders::CONTENT_TYPE] = HttpContentTypes::JSON;
        // prevent low version curl add a default pragma:no-cache
        $headers[HttpHeaders::PRAGMA] = '';
        $config['endpoint'] = $this->stsEndpoint;
        $config = array_merge(
            $this->config,
            $config
        );
        $path = HttpUtils::appendUri(StsClient::STS_URL_PREFIX, StsClient::GET_SESSION_TOKEN_VERSION, StsClient::GET_SESSION_TOKEN_PATH);

        $response = $this->httpClient->sendRequest(
            $config,
            HttpMethod::POST,
            $path,
            $acl,
            $headers,
            $params,
            $this->signer
        );
		
        return $this->parseJsonResult($response['body']);
    }
64305
public function request($url, array $options = array())
    {
        $options += array(
            'data' => null,
            'timeout' => 30,
            'context' => null,
            'method' => 'GET',
            'headers' => array()
        );

        if ($options['method'] === 'POST' && empty($options['headers'])) {
            $options['headers'] = array('Content-Type' => 'application/x-www-form-urlencoded');
        }

        if (!empty($options['query'])) {
            $url = strtok($url, '?') . '?' . http_build_query($options['query']);
        }

        return $this->setUri($url)
            ->setHeaders($options['headers'])
            ->setMethod($options['method'])
            ->setData($options['data'])
            ->setTimeOut($options['timeout'])
            ->setContext($options['context'])
            ->setSocket()
            ->exec()
            ->getFormattedResponse();
    }
325078
public function verifyEmailToken($options = []) {
		$options = Hash::merge(
			$this->getConfig('verifyEmailToken'),
			$options,
			['type' => 'Email']
		);

		return $this->verifyToken($options);
	}
551487
public function getAuthenticationURL($responseType = 'code', $state = null)
    {
        $httpQueryParameters = [
            'client_id' => $this->clientId,
            'response_type' => $responseType,
            'state' => $state,
        ];

        $httpQueryParameters = http_build_query($httpQueryParameters);

        return self::AUTHORIZATION_ENDPOINT . '?' . $httpQueryParameters;
    }
201730
protected function getAuthorizationParameters(array $options)
    {
//        I removed this from application authorization flow
//        if (empty($options['state'])) {
//            $options['state'] = $this->getRandomState();
//        }

//        if (empty($options['scope'])) {
//            $options['scope'] = $this->getDefaultScopes();
//        }

        if (empty($options['entity_id'])) {
            $options['entity_id'] = '';
        }

        $options += [
            'response_type' => 'code',
            'approval_prompt' => 'auto'
        ];

//        if (is_array($options['scope'])) {
//            $separator = $this->getScopeSeparator();
//            $options['scope'] = implode($separator, $options['scope']);
//        }

        // Store the state as it may need to be accessed later on.
//        $this->state = $options['state'];

        return [
            'client_id' => $this->clientId,
            'redirect_uri' => $this->redirectUri,
            'entity_id' => $options['entity_id'],
//            'state' => $this->state,
//            'scope' => $options['scope'],
            'response_type' => $options['response_type'],
            'approval_prompt' => $options['approval_prompt'],
        ];
    }