Get authentication info via email/password
424433
def login(email, password, opts = {})
      ensure_ready!
      opts = opts.merge(:email => email, :password => password)
      checked_response_body(connection.post('login', opts))
    end
1109080
def GetAuth(self):
        '''
        '''
        if self.auth: return self.auth
        for elt in self.ps.GetMyHeaderElements():
            if elt.localName == 'BasicAuth' \
            and elt.namespaceURI == ZSI_SCHEMA_URI:
                d = _auth_tc.parse(elt, self.ps)
                self.auth = (AUTH.zsibasic, d['Name'], d['Password'])
                return self.auth
        ba = self.environ.get('HTTP_AUTHENTICATION')
        if ba:
            ba = ba.split(' ')
            if len(ba) == 2 and ba[0].lower() == 'basic':
                ba = _b64_decode(ba[1])
                self.auth = (AUTH.httpbasic,) + tuple(ba.split(':'))
                return self.auth
        self.auth = (AUTH.none,)
        return self.auth
273291
def _get_client_and_key(url, user, password, verbose=0):
    '''
    
    '''
    session = {}
    session['client'] = six.moves.xmlrpc_client.Server(url, verbose=verbose, use_datetime=True)
    session['key'] = session['client'].auth.login(user, password)

    return session
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)
1107217
def user_login(self, email=None, password=None):
        
        email = six.moves.input("Email: ") if email is None else email
        password = getpass.getpass() if password is None else password

        login_data = {
            "method": "user.login",
            "params": {"email": email,
                       "pass": password}
        }
        # If the user/password match, the server respond will contain a
        #  session cookie that you can use to authenticate future requests.
        r = self.session.post(
            self.base_api_urls["logic"],
            data=json.dumps(login_data),
        )
        if r.json()["result"] not in ["OK"]:
            raise AuthenticationError("Could not authenticate.\n{}"
                                      .format(r.json()))
326864
def login(self, email=None, password=None, app_id=None, api_key=None):
        
        session_token = self.api.user_get_session_token(
            app_id=app_id, email=email, password=password, api_key=api_key)

        # install session token back into api client
        self.api.session = session_token
467628
def check_auth(self, username, password):
        '''  '''
        return username == self.queryname and password == self.querypw
311759
def _check_auth(self, username: str, password: str) -> bool:
        """"""
        try:
            return self.credentials[username] == password
        except KeyError:
            return False
947196
def _get_credentials(server=None,
                     username=None,
                     password=None):
    '''
    
    '''
    jira_cfg = __salt__['config.merge']('jira', default={})
    if not server:
        server = jira_cfg.get('server')
    if not username:
        username = jira_cfg.get('username')
    if not password:
        password = jira_cfg.get('password')
    return server, username, password
1272854
def get_authenticated_person(self):
        """"""
        try:
            output = self._get_data()
            self._logger.debug(output)
            person = Person([
                self.email,
                output[9][1],
                None,
                None,
                None,
                None,
                [
                    None,
                    None,
                    self.email,
                    self.email
                ],
                None,
                None,
                None,
                None,
                None,
                None,
                None,
            ])
        except (IndexError, TypeError, InvalidData):
            self._logger.debug('Missing essential info, cannot instantiate authenticated person')
            return None
        return person
813277
def auth(self):
        
        username = self._settings["username"]

        if not username:
            raise ValueError("Username was not configured in %s" % CONFIG_FILE)

        if self._settings["use_keyring"]:
            password = self.keyring_get_password(username)
            if not password:
                self.keyring_set_password(username)
                password = self.keyring_get_password(username)
        else:
            password = self._settings["password"]

        return self._settings["username"], password
568997
def authenticate(self, username="", password="", **kwargs):
        """"""
        try:
            user = get_user_model().objects.filter(email__iexact=username)[0]
            if check_password(password, user.password):
                return user
            else:
                return None
        except IndexError:
            # No user was found, return None - triggers default login failed
            return None
855313
def authenticate_with_email_and_pwd(user_email, user_password):
    '''
    
    '''
    if user_email is None or user_password is None:
        raise ValueError(
            'Could not authenticate user. Missing username or password')
    upload_token = uploader.get_upload_token(user_email, user_password)
    if not upload_token:
        print("Authentication failed for user name " +
              user_name + ", please try again.")
        sys.exit(1)
    user_key = get_user_key(user_name)
    if not user_key:
        print("User name {} does not exist, please try again or contact Mapillary user support.".format(
            user_name))
        sys.exit(1)
    user_permission_hash, user_signature_hash = get_user_hashes(
        user_key, upload_token)

    user_items["MAPSettingsUsername"] = section
    user_items["MAPSettingsUserKey"] = user_key

    user_items["user_upload_token"] = upload_token
    user_items["user_permission_hash"] = user_permission_hash
    user_items["user_signature_hash"] = user_signature_hash
    return user_items
476815
def authenticationRequest():
    """"""
    a = TpPd(pd=0x5)
    b = MessageType(mesType=0x12)  # 00010010
    c = CiphKeySeqNrAndSpareHalfOctets()
    d = AuthenticationParameterRAND()
    packet = a / b / c / d
    return packet
427785
def auth(self):
        
        if self.oauth:
            return self.oauth
        return (self.username, self.password)
603662
def sync_auth_info(options = {})

      opts = {
        "RunSynchAutoInfo" => 'True',
        "EmailEPP" => 'True'
      }
      opts["EmailEPP"] = 'True' if options[:email]

      Client.request({"Command" => "SynchAuthInfo", "SLD" => sld, "TLD" => tld}.merge(opts))
      return self
    end
478933
def get_email(self, token):
        """"""
        resp = requests.get(self.emails_url,
                            params={'access_token': token.token})
        emails = resp.json().get('values', [])
        email = ''
        try:
            email = emails[0].get('email')
            primary_emails = [e for e in emails if e.get('is_primary', False)]
            email = primary_emails[0].get('email')
        except (IndexError, TypeError, KeyError):
            return ''
        finally:
            return email