Registers the current user with the given password.
435843
def register(self, password):
        """"""

        if len(password) < 8:
            raise ValueError("Password must be at least 8 characters.")

        params = {"name": self.nick, "password": password}
        resp = self.conn.make_api_call("register", params)

        if "error" in resp:
            raise RuntimeError(f"{resp['error'].get('message') or resp['error']}")

        self.conn.make_call("useSession", resp["session"])
        self.conn.cookies.update({"session": resp["session"]})
        self.logged_in = True
1188094
def reset_password user, password
      Oath.config.password_reset_service.new(user, password).perform
    end
542200
async def set_password(self, password):
        
        await self.controller.change_user_password(self.username, password)
        self._user_info.password = password
459485
def register(username, password):
    
    check_for_cloud_server()
    server = Server(config["cloud_server"]["url"])
    server.create_user(username, password)
937518
def register(self):
        
        form = self._get_form('SECURITY_REGISTER_FORM')
        if form.validate_on_submit():
            user = self.security_service.user_manager.create(**form.to_dict())
            self.security_service.register_user(user)
            return self.redirect('SECURITY_POST_REGISTER_REDIRECT_ENDPOINT')

        return self.render('register',
                           register_user_form=form,
                           **self.security.run_ctx_processor('register'))
317313
def as_user(self, user, password):
        

        with self.options(user=user, password=password):
            yield self
172469
def add(self, user, password):
        
        if self.__contains__(user):
            raise UserExists
        self.new_users[user] = self._encrypt_password(password) + "\n"
411040
async def register_user(self, password, **kwds):
        
        # so make one
        user = await self._create_remote_user(password=password, **kwds)
        # if there is no pk field
        if not 'pk' in user:
            # make sure the user has a pk field
            user['pk'] = user['id']

        # the query to find a matching query
        match_query = self.model.user == user['id']

        # if the user has already been registered
        if self.model.select().where(match_query).count() > 0:
            # yell loudly
            raise RuntimeError('The user is already registered.')

        # create an entry in the user password table
        password = self.model(user=user['id'], password=password)

        # save it to the database
        password.save()

        # return a dictionary with the user we created and a session token for later use
        return {
            'user': user,
            'sessionToken': self._user_session_token(user)
        }
1142892
def oauth_register(form):
    
    if form.validate():
        data = form.to_dict()
        if not data.get('password'):
            data['password'] = ''
        user = register_user(**data)
        if not data['password']:
            user.password = None
        _datastore.commit()
        return user
1103632
async def _register(self):
        
        if self.registered:
            return
        self._registration_attempts += 1

        # Don't throttle during registration, most ircds don't care for flooding during registration,
        # and it might speed it up significantly.
        self.connection.throttle = False

        # Password first.
        if self.password:
            await self.rawmsg('PASS', self.password)

        # Then nickname...
        await self.set_nickname(self._attempt_nicknames.pop(0))
        # And now for the rest of the user information.
        await self.rawmsg('USER', self.username, '0', '*', self.realname)
449187
def update_password(user, password):
    
    user.password = hash_password(password)
    _datastore.put(user)
    send_password_reset_notice(user)
    password_reset.send(app._get_current_object(), user=user)
555198
async def login(self, password):
        """"""
        auth_resp = await self._client_request(
            'post',
            '{0}/auth/login'.format(self._host),
            json={
                'pwd': password,
                'remember': 1
            })

        self._access_token = auth_resp['access_token']
        self._access_token_expiration = datetime.now() + timedelta(
            seconds=int(auth_resp['expires_in']) - 10)
25097
def add_register_user(
        self, username, first_name, last_name, email, password="", hashed_password=""
    ):
        
        register_user = self.registeruser_model()
        register_user.username = username
        register_user.email = email
        register_user.first_name = first_name
        register_user.last_name = last_name
        if hashed_password:
            register_user.password = hashed_password
        else:
            register_user.password = generate_password_hash(password)
        register_user.registration_hash = str(uuid.uuid1())
        try:
            self.get_session.add(register_user)
            self.get_session.commit()
            return register_user
        except Exception as e:
            log.error(c.LOGMSG_ERR_SEC_ADD_REGISTER_USER.format(str(e)))
            self.appbuilder.get_session.rollback()
            return None
702691
def register(config, pconn):
    
    username = config.username
    password = config.password
    authmethod = config.authmethod
    auto_config = config.auto_config
    if not username and not password and not auto_config and authmethod == 'BASIC':
        logger.debug('Username and password must be defined in configuration file with BASIC authentication method.')
        return False
    return pconn.register()
134518
def register(self):
        
        user = {}

        print('--------------------------------------------------------------')
        print('Welcome to the user registration process.')
        print('--------------------------------------------------------------')
        print("To continue you must fill the following fields.")
        for attribute, value in self.attributes.items():

            is_required = attribute in self.required
            field_name = value['field_name']
            pattern = value['pattern']

            if attribute != 'password':
                user[attribute] = self.ask_question(field_name, pattern,
                                                    is_required)
            else:
                user[attribute] = self.ask_question(field_name, pattern,
                                                    password=True)

        return self._users_client.register(user)
666426
def set_password(self, password):
        
        self.password = Security.hash(password)
        self.save()
1196603
public void authenticate(String username, String password) {
		logger.debug("Authenticate:" + username);

		Authentication request = new UsernamePasswordAuthenticationToken(username, password);
		authenticationManager.authenticate(request);
	}