returns the oauth2 class
10543
def oauth2(self):
        
        if self._url.endswith("/oauth2"):
            url = self._url
        else:
            url = self._url + "/oauth2"
        return _oauth2.oauth2(oauth_url=url,
                              securityHandler=self._securityHandler,
                              proxy_url=self._proxy_url,
                              proxy_port=self._proxy_port)
812443
protected function getAuthClass(array $authConfig = []): Auth
    {
        $type = $authConfig['type'] ?? '';

        switch ($type) {
            case ClientCredentials::TYPE:
                return new ClientCredentials(
                    $authConfig['appId'],
                    $authConfig['appSecret']
                );
            case LegacyCredentials::TYPE:
                return new LegacyCredentials(
                    $authConfig['clientId'],
                    $authConfig['apiKey']
                );
            case RefreshCredentials::TYPE:
                return new RefreshCredentials(
                    $authConfig['appId'],
                    $authConfig['appSecret'],
                    $authConfig['refreshToken']
                );
            default:
                return new NullCredentials();
        }
    }
859148
public String getGrantType() {
		if (getRequestParameters().containsKey(OAuth2Utils.GRANT_TYPE)) {
			return getRequestParameters().get(OAuth2Utils.GRANT_TYPE);
		}
		if (getRequestParameters().containsKey(OAuth2Utils.RESPONSE_TYPE)) {
			String response = getRequestParameters().get(OAuth2Utils.RESPONSE_TYPE);
			if (response.contains("token")) {
				return "implicit";
			}
		}
		return null;
	}
258987
function getAuthenticationObject () {
    const authString = url.parse(parts[0]).auth;

    if (authString) {
      return {
        source: getName(),
        user: authString.split(':')[0],
        pass: authString.split(':')[1]
      };
    } else {
      return {};
    }
  }
182437
def get_authorization_url(self):
        """"""
        url = self._get_oauth_url('authenticate')
        query = {
            'client_id': self._client_id,
            'response_type': 'code',
            'redirect_uri': self.callback
        }
        query_str = self.urlencode(query)

        return url + '?' + query_str
867092
def get_oauth_token_key_name(self, provider):
        
        for _provider in self.oauth_providers:
            if _provider["name"] == provider:
                return _provider.get("token_key", "oauth_token")
1039847
public function getOAUTHInstance()
    {
        if (!is_object($this->oauth)) {
            $this->oauth = new PHPMailerOAuthGoogle(
                $this->oauthUserEmail,
                $this->oauthClientSecret,
                $this->oauthClientId,
                $this->oauthRefreshToken
            );
        }
        return $this->oauth;
    }
747793
def _get_auth_header(self):
        '''  '''
        realm = 'realm="{realm}"'.format(realm=self.realm)
        params = ['{k}="{v}"'.format(k=k, v=quote(str(v), safe=''))
                  for k, v in self.oauth_params.items()]
        return 'OAuth ' + ','.join([realm] + params)
299304
def get_auth(self):
        """"""
        auth_resp = get_with_retry(self.cerberus_url + '/v2/auth/user',
                                 auth=(self.username, self.password),
                                 headers=self.HEADERS)

        if auth_resp.status_code != 200:
            throw_if_bad_response(auth_resp)

        return auth_resp.json()
43689
def auth_uri(self):

        """"""

        return self.oauth.auth_uri(redirect_uri=self.redirect_uri, scope=self.scope)
1020382
def _get_object_class(cls, class_name):
        

        class_name = class_name.lstrip(cls.__STRING_FORMAT_UNDERSCORE)

        if class_name in cls._override_field_map:
            class_name = cls._override_field_map[class_name]

        try:
            return getattr(endpoint, class_name)
        except AttributeError:
            pass

        try:
            return getattr(object_, class_name)
        except AttributeError:
            pass

        raise BunqException(cls._ERROR_MODEL_NOT_FOUND.format(class_name))
254770
function create_oauth2_client () {
  var google_client_id = (OPTIONS.GOOGLE_CLIENT_ID) ? OPTIONS.GOOGLE_CLIENT_ID : process.env.GOOGLE_CLIENT_ID;
  var google_client_secret = (OPTIONS.GOOGLE_CLIENT_SECRET) ? OPTIONS.GOOGLE_CLIENT_SECRET : process.env.GOOGLE_CLIENT_SECRET;
  var base_url = (OPTIONS.BASE_URL) ? OPTIONS.BASE_URL : process.env.BASE_URL;
  oauth2_client = new OAuth2Client(
    google_client_id,
    google_client_secret,
    base_url + OPTIONS.REDIRECT_URL
  );
  return oauth2_client;
}
1290909
def login_oauth2(self, username, password, mfa_code=None):
        '''
        
        '''
        data = {
            "grant_type": "password",
            "scope": "internal",
            "client_id": CLIENT_ID,
            "expires_in": 86400,
            "password": password,
            "username": username
        }
        if mfa_code is not None:
            data['mfa_code'] = mfa_code
        url = "https://api.robinhood.com/oauth2/token/"
        res = self.post(url, payload=data, retry=False)

        if res is None:
            if mfa_code is None:
                msg = ("Client.login_oauth2(). Could not authenticate. Check "
                       + "username and password.")
                raise AuthenticationError(msg)
            else:
                msg = ("Client.login_oauth2(). Could not authenticate. Check" +
                       "username and password, and enter a valid MFA code.")
                raise AuthenticationError(msg)
        elif res.get('mfa_required') is True:
            msg = "Client.login_oauth2(). Couldn't authenticate. MFA required."
            raise AuthenticationError(msg)

        self.access_token = res["access_token"]
        self.refresh_token = res["refresh_token"]
        self.mfa_code = res["mfa_code"]
        self.scope = res["scope"]
        self.__set_account_info()
        return self.authenticated
61612
def get_oauth_authcfg(authcfg_id=AUTHCFG_ID):
    """"""
    # Handle empty strings
    if not authcfg_id:
        authcfg_id = AUTHCFG_ID
    configs = auth_manager().availableAuthMethodConfigs()
    if authcfg_id in configs \
            and configs[authcfg_id].isValid() \
            and configs[authcfg_id].method() == 'OAuth2':
        return configs[authcfg_id]
    return None
643487
function getClass(o) {

	if (o === null || o === undefined) return "Object";
	return OP_toString.call(o).slice("[object ".length, -1);
}
1125183
def getPyClass(self):
        '''
        '''
        # --> EXTENDED
        if self.hasExtPyClass():
            classInfo = self.extPyClasses[self.name]
            return ".".join(classInfo)
        # <-- 
        
        return 'Holder'
1225256
def get_authentication_tokens(self):
        
        callback_url = self.callback_url or 'oob'
        request_args = {}
        if OAUTH_LIB_SUPPORTS_CALLBACK:
            request_args['callback_url'] = callback_url

        resp, content = self.client.request(self.request_token_url,
            "GET", **request_args)

        if resp['status'] != '200':
            raise AuthError("Seems something couldn't be verified "\
                "withyour OAuth junk. Error: %s, Message: %s" \
                % (resp['status'], content))

        request_tokens = dict(urlparse.parse_qsl(content))
        oauth_callback_confirmed = request_tokens\
            .get('oauth_callback_confirmed') == 'true'

        if not OAUTH_LIB_SUPPORTS_CALLBACK and callback_url != 'oob'\
            and oauth_callback_confirmed:
            import warnings
            warnings.warn("oauth2 library doesn't support OAuth 1.0a"\
                " type callback, but remote requires it")
            oauth_callback_confirmed = False

        auth_url_params = {'oauth_token': request_tokens['oauth_token']}

        # Use old-style callback argument
        if callback_url != 'oob' and not oauth_callback_confirmed:
            auth_url_params['oauth_callback'] = callback_url

        request_tokens['auth_url'] = self.authenticate_url + '?'\
            + urllib.urlencode(auth_url_params)

        return request_tokens