Parse a new authorize request

@param string $type The session owner's type
@param string $typeId The session owner's ID
@param array $authParams The authorize request $_GET parameters

@return string
347720
public function newAuthorizeRequest($type, $typeId, $authParams = [])
    {
        if ($this->authorizationServer->hasGrantType('authorization_code')) {
            /** @var AuthCodeGrant $authGrant */
            $authGrant = $this->authorizationServer->getGrantType('authorization_code');
            return $authGrant->newAuthorizeRequest($type, $typeId, $authParams);
        }

        return '';
    }
1309913
public function getAuthUserParamName() : ?string
   {

      foreach ( $this->_attributes as $attribute )
      {
         if ( Type::USERNAME_PARAM === $attribute->getType() )
         {
            return $attribute->getName();
         }
      }

      return null;

   }
1236780
public static function getRequestParams($type = 'all')
    {
        $request = Yii::$app->getRequest();
        switch ($type) {
            case 'get':
                $params = $request->get();
                break;

            case 'post':
                $params = $request->post();
                break;

            case 'all':
            default:
                $params = ArrayHelper::merge($request->get(), $request->post());
                break;
        }

        return $params;
    }
1193149
public function getUidAppid($uid = '', $type = "all") {
        $key  = md5($uid . md5($uid . 'thirdAuthorizeCallback') . "_wechat");
        $data = to_array(F($key, '[get]'));
        if ($data) {
            switch ($type) {
            case 'appid':
                return $data['authorizer_appid'];
                break;
            default:
                return $data;
                break;
            }
        } else {
            return false;
        }
    }
571978
public function request($type, $params = array())
    {
        if (isset($this->iTunesConfig['api'])) {
            if (
                isset($this->iTunesConfig['api']['url']) &&
                isset($this->iTunesConfig['api']['search_uri']) &&
                isset($this->iTunesConfig['api']['lookup_uri'])
            ) {
                $host = $this->iTunesConfig['api']['url'];

                switch ($type) {
                    case 'search':
                    default:
                        $uri = $this->iTunesConfig['api']['search_uri'];
                        $params = array_merge(
                            array(
                                'limit' => isset($this->iTunesConfig['limit']) ? $this->iTunesConfig['limit'] : 50,
                            ),
                            $params
                        );
                    break;

                    case 'lookup':
                        $uri = $this->iTunesConfig['api']['lookup_uri'];
                    break;
                }

                return array(
                    'url' => $host.$uri,
                    'params' => $params,
                );
            }
        }

        throw new ConfigurationException('Incomplete Configuration');
    }
1154518
public function doRequest($type, $url, $params, $options = [], $headers = []) {
        // get access to the curl wrapper and set the bearer
        $curl = CURL::setBearer($this->getAccessToken());

        // set the request options
        foreach ($options as $var => $value) {
            $curl->setOption($var, $value);
        }

        // set the header values
        foreach ($headers as $var => $value) {
            $curl->setHeader($var, $value);
        }

        // execute the request
        $result = $curl->$type($url, $params);

        // done, return the result
        return $result;
    }
484938
private function sign($type, &$params)
	{

		ksort($params);
		$str4sign = implode('|', $params);
		$sign = md5($str4sign . $type . $this->configParams['secretKey']);

		return $sign;

	}
821028
private function create(array $queryParameters, string $request = null, string $auth = null)
    {
        $url = self::$base_url.'/create?'.http_build_query($queryParameters);

        $header = [];

        if ($auth) {
            $header['X-Registry-Auth'] = $auth;
        }

        return self::$curl->post($url, $request, $header);
    }
85991
public function verify($credentials, $type = 'jwt_auth')
    {
        $result = false;
        try {
            $auth = $this->container["AUTHENTICATIONS"][$type];
            $result = $auth->verify($credentials);
        } catch (\Exception $e) {
            \error_log($e->getMessage());
        }
        return $result;
    }
30922
public function finishAuthentication(
        AuthenticationType $type,
        User $u
    ) {
        if (!$type || !($type instanceof AuthenticationType)) {
            return $this->view();
        }
        $config = $this->app->make('config');
        if ($config->get('concrete.i18n.choose_language_login')) {
            $userLocale = $this->post('USER_LOCALE');
            if (is_string($userLocale) && ($userLocale !== '')) {
                if ($userLocale !== Localization::BASE_LOCALE) {
                    $availableLocales = Localization::getAvailableInterfaceLanguages();
                    if (!in_array($userLocale, $availableLocales)) {
                        $userLocale = '';
                    }
                }
                if ($userLocale !== '') {
                    if (Localization::activeLocale() !== $userLocale) {
                        Localization::changeLocale($userLocale);
                    }
                    $u->setUserDefaultLanguage($userLocale);
                }
            }
        }

        $ui = UserInfo::getByID($u->getUserID());
        $aks = UserAttributeKey::getRegistrationList();

        $unfilled = array_values(
            array_filter(
                $aks,
                function ($ak) use ($ui) {
                    return $ak->isAttributeKeyRequiredOnRegister() && !is_object($ui->getAttributeValueObject($ak));
                }));

        if (count($unfilled)) {
            $u->logout(false);

            if (!$this->error) {
                $this->on_start();
            }

            $this->set('required_attributes', $unfilled);
            $this->set('u', $u);

            $session = $this->app->make('session');
            $session->set('uRequiredAttributeUser', $u->getUserID());
            $session->set('uRequiredAttributeUserAuthenticationType', $type->getAuthenticationTypeHandle());

            $this->view();

            return $this->getViewObject()->render();
        }

        $u->setLastAuthType($type);

        $ue = new \Concrete\Core\User\Event\User($u);
        $this->app->make('director')->dispatch('on_user_login', $ue);

        return new RedirectResponse(
            $this->app->make('url/manager')->resolve(['/login', 'login_complete'])
        );
    }
1044469
public function request($type, $url, $args = [])
    {
        $response = $this->getHTTPClient()
            ->$type($url, $args)
            ->getBody()
            ->getContents();

        return json_decode($response);
    }
1091602
public function requestUserData($type = 'private', $access_token = null)
    {
        $config = $this->getConfig();
        $access_token = ($access_token) ? $access_token : $this->getAccessToken();
        $url = null;

        switch ($type) {
            case 'public':
                //error if no profile set
                if (!$this->getPublicProfileUrl()) {
                    throw new \Exception('please set the public profile you want to pull');
                }

                $url = $config['urls']['public']
                    . urlencode(urldecode($this->getPublicProfileUrl()))  // make sure the url is encoded; avoid double encoding
                    . $config['dataset'][$type]['fields'];
                break;
            case 'private':
            case 'login':
            default:
                $url = $config['urls']['private']
                    . $config['dataset'][$type]['fields'];
                break;
        }

        //add access token to request url
        $url .= '?' . http_build_query(array('oauth2_access_token' => $access_token, 'secure-urls' => 'true'));

        //send it
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_VERBOSE, 0);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);  // don't worry about bad ssl certs
        curl_setopt($ch, CURLOPT_HTTPHEADER, array("Accept-Language: en-US, ja"));
        $response = curl_exec($ch);

        $data = simplexml_load_string($response);

        return $data;
    }
1360750
public function authRedirect($exit = true, $type = self::CODE_AUTH_TYPE, $state = null)
    {
        header('Location: ' . $this->getAuthUrl($type, $state));

        return $exit ? exit() : true;
    }
383410
protected function createAuthentication(ContainerBuilder $container, $authentication, $type)
    {
        if ($authentication['type'] == 'basic' && (!isset($authentication['username']) || !isset($authentication['password']))) {
            throw new \LogicException('Username and password are mandatory if using the basic authentication');
        }

        if ($authentication['type'] == 'basic') {
            // Create an authentication service
            $authenticationDefinition = new Definition(
                'Bluetea\Api\Authentication\BasicAuthentication',
                array('username' => $authentication['username'], 'password' => $authentication['password'])
            );
        } elseif ($authentication['type'] == 'anonymous') {
            // Create an authentication service
            $authenticationDefinition = new Definition(
                'Bluetea\Api\Authentication\AnonymousAuthentication'
            );
        } else {
            throw new InvalidConfigurationException('Invalid authentication');
        }

        $container->setDefinition(sprintf('jira_rest_api.%s_authentication', $type), $authenticationDefinition);
    }
1113386
public function getAuthorization(string $authCorpId, string $permanentCode)
    {
        $params = [
            'auth_corpid' => $authCorpId,
            'permanent_code' => $permanentCode,
        ];

        return $this->httpPostJson('cgi-bin/service/get_auth_info', $params);
    }
290333
private function setAuthenticationParametersNoValidation($params = null)
    {
        // Return if authentication property not set
        if ($this->auth == null) {
            return $params;
        }

        // Set parameters for previously configured auth properties
        // Get property list from auth class
        $auth_refl = new \ReflectionClass($this->auth);
        $props = $auth_refl->getProperties(\ReflectionProperty::IS_PUBLIC);

        /*
         * Loop through property names to determine if configured in auth object.
         * Add to parameters if set and does not already exist.
         */
        foreach ($props as $prop) {
            $name = $prop->getName();
            if (isset($this->auth->$name)) {
                // Do not overwrite if parameter already included
                $key = $this->auth->getAuthKeyByVar($name);
                if (!isset($params[$key])) {
                    $params[$key] = $this->auth->$name;
                }
            }
        }

        return $params;
    }
1313757
public static function createInstance($type, $authenticator, $domain = null)
	{
		if (empty($type) || empty($authenticator))
		{
			return false;
		}

		$row = self::blank();
		$row->set('type', $type);
		$row->set('authenticator', $authenticator);
		if ($domain)
		{
			$row->set('domain', $domain);
		}
		$row->save();

		if (!$row->get('id'))
		{
			return false;
		}

		return $row;
	}