Logs into the wiki with username *user* and password *passwd*. Returns
        ``True`` on successful login.

        :param user: username
        :param passwd: password
        :returns: ``True`` on successful login, otherwise ``False``
353706
def login(self, user, passwd):
        
        def do_login(self, user, passwd, token=None):
            """
            Login function that handles CSRF protection (see `MediaWiki bug
            23076`_). Returns ``True`` on successful login.

            .. _`MediaWiki bug 23076`:
                https://bugzilla.wikimedia.org/show_bug.cgi?id=23076
            """
            data = {'action': 'login',
                    'lgname': user,
                    'lgpassword': passwd}
            if token:
                data['lgtoken'] = token
            result = self.call(data)
            if result['login']['result'] == 'Success':
                self._high_limits = None
                return True
            elif result['login']['result'] == 'NeedToken' and not token:
                return do_login(self, user, passwd, result['login']['token'])
            else:
                return False

        return do_login(self, user, passwd)
721076
def login(self, username, password):
        

        data = self._authenticate(
            grant_type='password',
            username=username,
            password=password,
            client_id=self._client_id,
            client_secret=self._client_secret
        )

        self._username = username
        self._password = password

        return data
633189
def login(username=None, password=None):
    
    global user
    user = UserConfig()
    if username:
        user.username = username
    else:
        user.username = user.input_username()

    if password:
        user.password = password
    else:
        user.password = user.input_password()

    if (not ( user.username and user.password) ):
        logging.error("Username and password must be provided for login")
        return;
    user.retrieve_keycloak_token()
    user.apiclient = user.create_api_client()
    save()
35426
def auth(username, password):
    '''
    
    '''
    django_auth_path = __opts__['django_auth_path']
    if django_auth_path not in sys.path:
        sys.path.append(django_auth_path)
    os.environ.setdefault('DJANGO_SETTINGS_MODULE', __opts__['django_auth_settings'])

    __django_auth_setup()

    if not is_connection_usable():
        connection.close()

    import django.contrib.auth  # pylint: disable=import-error,3rd-party-module-not-gated
    user = django.contrib.auth.authenticate(username=username, password=password)
    if user is not None:
        if user.is_active:
            log.debug('Django authentication successful')
            return True
        else:
            log.debug('Django authentication: the password is valid but the account is disabled.')
    else:
        log.debug('Django authentication failed.')

    return False
555078
def _username():
    '''
    
    '''
    if pwd:
        username = pwd.getpwuid(os.getuid()).pw_name
    else:
        username = getpass.getuser()

    return username
975590
def login(self, username: str='anonymous', password: str='-wpull-lib@'):
        '''
        '''
        yield from self._control_stream.write_command(Command('USER', username))

        reply = yield from self._control_stream.read_reply()

        if reply.code == ReplyCodes.user_logged_in_proceed:
            return

        self.raise_if_not_match(
            'Login username', ReplyCodes.user_name_okay_need_password, reply)

        yield from self._control_stream.write_command(Command('PASS', password))

        reply = yield from self._control_stream.read_reply()

        self.raise_if_not_match(
            'Login password', ReplyCodes.user_logged_in_proceed, reply)
472018
def check_my_users(user):
    
    user_data = my_users.get(user['username'])
    if not user_data:
        return False  # <--- invalid credentials
    elif user_data.get('password') == user['password']:
        return True  # <--- user is logged in!

    return False
784861
def authenticate(self, username, password, db=None):
        
        if db is None:
            return self.get_connection().admin.authenticate(username, password)
        return self.get_connection()[db].authenticate(username, password)
251028
def authenticate(self, username, password):
        

        if username is None or password is None:
            return False

        # check the username
        if not re.match("^[A-Za-z0-9_-]*$", username):
            return False

        user_dn = self.get_user_dn(username)

        server = ldap3.Server(
                self.uri,
                use_ssl=self.use_ssl
            )

        connection = ldap3.Connection(server, user=user_dn, password=password)

        return connection.bind()
7375
def register_with_password(self, username, password):
        
        response = self.api.register(
                auth_body={"type": "m.login.dummy"},
                kind='user',
                username=username,
                password=password,
        )
        return self._post_registration(response)
130645
def prompt_user_passwd(self, host, realm):
        """"""
        import getpass
        try:
            user = input("Enter username for %s at %s: " % (realm, host))
            passwd = getpass.getpass("Enter password for %s in %s at %s: " %
                (user, realm, host))
            return user, passwd
        except KeyboardInterrupt:
            print()
            return None, None
1359908
def login(self, login, password):
        
        self.client.read_until('Username: ')
        self.client.write(login + '\r\n')
        self.client.read_until('Password: ')
        self.client.write(password + '\r\n')
        current_data = self.client.read_until('$ ', 10)
        if not current_data.endswith('$ '):
            raise InvalidLogin
1166751
def setCredentials(self, user, password):
        
        self._checkUserAndPass(user, password)
        self.user = user
        self.password = password
616389
def login(self, usr, pwd):
        
        self._usr = usr
        self._pwd = pwd
175299
def login(self, username, password):
        
        response = self.session.post(
            os.path.join(self.identity_url, 'certlogin'),
            cert=self.cert_file,
            data=urllib.urlencode({
                'username': username,
                'password': password,
            }),
            headers={
                'X-Application': self.app_key,
                'Content-Type': 'application/x-www-form-urlencoded',
            },
            timeout=self.timeout,
        )
        utils.check_status_code(response, [httplib.OK])
        data = response.json()
        if data.get('loginStatus') != 'SUCCESS':
            raise exceptions.LoginError(response, data)
        self.session_token = data['sessionToken']
702207
def login(user, password)
      data = request('authenticateUser',
                     { username: user, password: password },
                     true)
      @user = User.new(self, data)
      fail InvalidAuthentication, 'Wrong username or password!' if @user.id == 0

      @user
    end
1180460
def set_user_password(environment, parameter, password):
    
    username = '%s:%s' % (environment, parameter)
    return password_set(username, password)