List all enabled auth methods.

        Supported methods:
            GET: /sys/auth. Produces: 200 application/json

        :return: The JSON response of the request.
        :rtype: dict
760122
def list_auth_methods(self):
        
        api_path = '/v1/sys/auth'
        response = self._adapter.get(
            url=api_path,
        )
        return response.json()
384170
def auth(username, password):
    '''
    
    '''

    url = rest_auth_setup()

    data = {'username': username, 'password': password}

    # Post to the API endpoint. If 200 is returned then the result will be the ACLs
    # for this user
    result = salt.utils.http.query(url, method='POST', data=data, status=True,
                                   decode=True)
    if result['status'] == 200:
        log.debug('eauth REST call returned 200: %s', result)
        if result['dict'] is not None:
            return result['dict']
        return True
    else:
        log.debug('eauth REST call failed: %s', result)
        return False
244528
def get_api(self):
        
        return {'class': type(self._object).__name__, 'methods': list(self._function_map.keys())}
72742
def getsshkeys(self):
        
        request = requests.get(
            self.keys_url, headers=self.headers, verify=self.verify_ssl, auth=self.auth, timeout=self.timeout)

        if request.status_code == 200:
            return request.json()
        else:
            return False
202734
def get_required_signatures(self):
        
        headers, data = self._requester.requestJsonAndCheck(
            "GET",
            self.protection_url + "/required_signatures",
            headers={'Accept': Consts.signaturesProtectedBranchesPreview}
        )
        return data["enabled"]
96914
def _is_auth_info_available():
  """"""
  return (_ENDPOINTS_USER_INFO in os.environ or
          (_ENV_AUTH_EMAIL in os.environ and _ENV_AUTH_DOMAIN in os.environ) or
          _ENV_USE_OAUTH_SCOPE in os.environ)
1288483
def services(self):
        
        self._services = []
        params = {
                    "f" : "json"
                }
        json_dict = self._get(url=self._currentURL,
                                 param_dict=params,
                                 securityHandler=self._securityHandler,
                                 proxy_url=self._proxy_url,
                                 proxy_port=self._proxy_port)
        if "services" in json_dict.keys():
            for s in json_dict['services']:
                uURL = self._currentURL + "/%s.%s" % (s['serviceName'], s['type'])
                self._services.append(
                    AGSService(url=uURL,
                               securityHandler=self._securityHandler,
                               proxy_url=self._proxy_url,
                               proxy_port=self._proxy_port)
                )
        return self._services
1261332
async def _get_auth_page(self) -> str:
        
        # Prepare request
        params = {
            'client_id': self.app_id,
            'redirect_uri': 'https://oauth.vk.com/blank.html',
            'display': 'mobile',
            'response_type': 'token',
            'v': self.API_VERSION
        }
        if self.scope:
            params['scope'] = self.scope

        # Send request
        status, response = await self.driver.get_text(self.AUTH_URL, params)

        # Process response
        if status != 200:
            error_dict = json.loads(response)
            raise VkAuthError(error_dict['error'], error_dict['error_description'], self.AUTH_URL, params)
        return response
391120
def get_lists(client):
    '''  '''
    response = client.authenticated_request(client.api.Endpoints.LISTS)
    return response.json()
172793
def auth():
    
    # the template context
    context = {
        'name': 'auth',
    }

    render_template(template='common', context=context)
    render_template(template='auth', context=context)
992644
def _get(self, *args, **kwargs):
        
        response = requests.get(*args, **kwargs)

        response.raise_for_status()

        return response.json()
1320021
def auth_params
      return {} unless Softlayer.configuration
      auth_hash = {
        authenticate: {
          'username' => Softlayer.configuration.username,
          'apiKey' => Softlayer.configuration.api_key
        }
      }
      auth_hash.merge!({
        "clientLegacySession" =>
          {
            "userId" => Softlayer.configuration.impersonate_user,
            "authToken" => Softlayer.configuration.impersonate_token
          }
      }) if Softlayer.impersonating?
      auth_hash
    end
3575
def getMethods(self):
        
        callables = {}

        for name in dir(self.service):
            method = getattr(self.service, name)

            if name.startswith('_') or not python.callable(method):
                continue

            callables[name] = method

        return callables
761803
def get_headers(self):
        """"""

        try:
            return {
                'X-Auth-User': self.job_args['os_user'],
                'X-Auth-Key': self.job_args['os_apikey']
            }
        except KeyError as exp:
            raise exceptions.AuthenticationProblem(
                'Missing Credentials. Error: %s',
                exp
            )
298254
def index(cls):
        
        res = requests.get(cls.URL, headers=HEADERS, verify=False)
        res.raise_for_status()
        return res.json()
71276
def API_GET(self):  # pylint: disable=arguments-differ
        
        if self.user_manager.session_logged_in():
            return 200, {"authenticated": True, "username": self.user_manager.session_username()}
        else:
            return 200, {"authenticated": False}
624617
def api(self):
        
        functions = [x[0]for x in inspect.getmembers(self, predicate=inspect.ismethod)
                     if not x[0].startswith('_')]

        full_api = {
            'doc': u"When posting data you have to use the JSON format.",
            'api': []
        }
        my_daemon_type = "%s" % getattr(self.app, 'type', 'unknown')
        my_address = getattr(self.app, 'host_name', getattr(self.app, 'name', 'unknown'))
        if getattr(self.app, 'address', '127.0.0.1') not in ['127.0.0.1']:
            # If an address is explicitely specified, I must use it!
            my_address = self.app.address
        for fun in functions:
            endpoint = {
                'daemon': my_daemon_type,
                'name': fun,
                'doc': getattr(self, fun).__doc__,
                'uri': '%s://%s:%s/%s' % (getattr(self.app, 'scheme', 'http'),
                                          my_address,
                                          self.app.port, fun),
                'args': {}
            }

            try:
                spec = inspect.getfullargspec(getattr(self, fun))
            except Exception:  # pylint: disable=broad-except
                # pylint: disable=deprecated-method
                spec = inspect.getargspec(getattr(self, fun))
            args = [a for a in spec.args if a not in ('self', 'cls')]
            if spec.defaults:
                a_dict = dict(list(zip(args, spec.defaults)))
            else:
                a_dict = dict(list(zip(args, ("No default value",) * len(args))))

            endpoint["args"] = a_dict
            full_api['api'].append(endpoint)

        return full_api