Sign in the user
544894
public function onSignin()
    {
        try {
            /*
             * Validate input
             */
            $data = post();
            $rules = [];

            $rules['login'] = $this->loginAttribute() == UserSettings::LOGIN_USERNAME
                ? 'required|between:2,255'
                : 'required|email|between:6,255';

            $rules['password'] = 'required|between:4,255';

            if (!array_key_exists('login', $data)) {
                $data['login'] = post('username', post('email'));
            }

            $validation = Validator::make($data, $rules);
            if ($validation->fails()) {
                throw new ValidationException($validation);
            }

            /*
             * Authenticate user
             */
            $credentials = [
                'login'    => array_get($data, 'login'),
                'password' => array_get($data, 'password')
            ];

            Event::fire('rainlab.user.beforeAuthenticate', [$this, $credentials]);

            $user = Auth::authenticate($credentials, true);
            if ($user->isBanned()) {
                Auth::logout();
                throw new AuthException(/*Sorry, this user is currently not activated. Please contact us for further assistance.*/'rainlab.user::lang.account.banned');
            }

            /*
             * Redirect
             */
            if ($redirect = $this->makeRedirection(true)) {
                return $redirect;
            }
        }
        catch (Exception $ex) {
            if (Request::ajax()) throw $ex;
            else Flash::error($ex->getMessage());
        }
    }
1371824
def add_user(self, username, password):
        """"""
        self.server.user_dict[username] = password
        self.server.isAuth = True
113518
public void signin(String username, String password) {
		logger.debug("signin:" + username);

		Authentication request = new UsernamePasswordAuthenticationToken(username, password, null);
		SecurityContextHolder.getContext().setAuthentication(request);
	}
1182496
def sign_in(self, email, password):
        """"""
        self.email = email
        self.login_password = password
        if self.is_element_present(*self._next_button_locator):
            self.wait.until(expected.visibility_of_element_located(
                self._next_button_locator))
            self.click_next()
        self.click_sign_in()
1327521
def login_generic(request, username, password):
        """"""
        user = authenticate(username=username, password=password)
        if user is not None and user.is_active:
            login(request, user)
            return True
        return False
325317
function createUser (req, res, next) {
    User.insert(req.body, { private: true }, function (err, user) {
      if (err) {
        res.render('signup', {
          params: qs.stringify(req.body),
          request: req.body,
          providers: settings.providers,
          error: err.message
        })
      } else {
        authenticator.dispatch('password', req, res, next, function (err, user, info) {
          if (err) { return next(err) }
          if (!user) {
          } else {
            authenticator.login(req, user)
            req.sendVerificationEmail =
              req.provider.emailVerification.enable
            req.flash('isNewUser', true)
            next()
          }
        })
      }
    })
  }
1249614
def activate(options = {})
      options = options.merge(
        user_name: @user_name,
        certificate_id: @id,
        status: "Active"
      )
      resp = @client.update_signing_certificate(options)
      resp.data
    end
83274
function updateSigninStatus(isSignedIn) {

        if (isSignedIn) {
            //$("#signInButton").hide();

            var user = gapi.auth2.getAuthInstance().currentUser.get();
            var profile = user.getBasicProfile();
            var username = profile.getName();
            $("#switchUserLink").html("Logged in as: " + username);

        }

    }
1124500
def QA_user_sign_in(username, password):
    
    #user = QA_User(name= name, password=password)
    cursor = DATABASE.user.find_one(
        {'username': username, 'password': password})
    if cursor is None:
        QA_util_log_info('SOMETHING WRONG')
        return False
    else:
        return True
937466
def sign_in(authenticatable)
      key = cookie_name(authenticatable.class)
      cookies.encrypted.permanent[key] = {value: authenticatable.id}
      authenticatable
    end
813742
def create_user(user, opts = {})
      data, _status_code, _headers = create_user_with_http_info(user, opts)
      return data
    end
945289
def register():
    
    if request.method == "POST":
        username = request.form["username"]
        password = request.form["password"]
        error = None

        if not username:
            error = "Username is required."
        elif not password:
            error = "Password is required."
        elif db.session.query(
            User.query.filter_by(username=username).exists()
        ).scalar():
            error = f"User {username} is already registered."

        if error is None:
            # the name is available, create the user and go to the login page
            db.session.add(User(username=username, password=password))
            db.session.commit()
            return redirect(url_for("auth.login"))

        flash(error)

    return render_template("auth/register.html")
317313
def as_user(self, user, password):
        

        with self.options(user=user, password=password):
            yield self
640153
def login(self):
        """"""
        response = self.session.get(self.signin_url, verify=False)
        user_param, password_param = self._get_hashed_params(response.text)
        login_data = {
            user_param: self.config['username'],
            password_param: self.config['password'],
            'once': self._get_once(response.text),
            'next': '/'
        }
        headers = {'Referer': 'https://www.v2ex.com/signin'}
        self.session.post(self.signin_url, headers=headers, data=login_data)
372760
def user_loggedin(sender, **kwargs):
    
    values = {
        'value': 1,
        'path': kwargs['request'].path,
        'user_id': str(kwargs['user'].pk),
        'username': kwargs['user'].username,
    }
    write('user_logins', values=values)
711254
function signIn (selection) {
  return dom.create('div').class('sign-in')
    .add(dom.create('input').class('username-input'))
    .add(dom.create('input').class('password-input'))
    .add(dom.create('button').class('sign-in-button').text('Sign in'))
}
81151
function addUser(user) {
	var slElement = $(document.createElement("option"));
	slElement.attr("value", user);
	slElement.text(user);
	$("#usersList").append(slElement);
}