Login an user by ID.
541755
async def login(self, request, id_):
        """"""
        session = await self.load(request)
        session['id'] = id_
409173
public function force_login($user_id = '')
	{
		if (empty($user_id))
		{
			return false;
		}

		$this->user = \DB::select_array(\Config::get('simpleauth.table_columns', array('*')))
			->where_open()
			->where('id', '=', $user_id)
			->where_close()
			->from(\Config::get('simpleauth.table_name'))
			->execute(\Config::get('simpleauth.db_connection'))
			->current();

		if ($this->user == false)
		{
			$this->user = \Config::get('simpleauth.guest_login', true) ? static::$guest_login : false;
			\Session::delete('username');
			\Session::delete('login_hash');
			return false;
		}

		\Session::set('username', $this->user['username']);
		\Session::set('login_hash', $this->create_login_hash());
		return true;
	}
927800
function login($id,$pw,$realm=NULL) {
		return $this->{'_'.$this->storage}($id,$pw,$realm);
	}
579530
def login(self, user, passwd):
        ''''''
        resp = self.post('token', json={'username': user, 'password': passwd})
        self._token = resp.json()['response']['token']
1341162
def authenticate_credentials(self, userid, password, request=None):
        """"""

        user = auth.authenticate(username=userid, password=password)

        if user is None or (user and not user.is_active):
            raise exceptions.AuthenticationFailed("Invalid username/password.")

        return (user, None)
1018180
def login(self, username=None, password=''):
        """"""
        self.username = username
        self.password = password
        return self._login()
563376
def login(self, identity, credentials):
        '''
        '''
        result = self.dispatcher.session.post(self._url('v0/auth/login'),
                                              json={
                                                  'email': identity,
                                                  'password': credentials
                                              })
        status = result.status_code
        if status == 400:
            raise APIException('invalid parameters, login process has changed')
        elif status == 401:
            # do our best to get something out to the user
            msg = result.text
            try:
                msg = json.loads(result.text)['message']
            finally:
                raise InvalidIdentity(msg)
        elif status != 200:
            raise APIException('%s: %s' % (status, result.text))
        jwt = result.text
        payload = jwt.split('.')[1]
        rem = len(payload) % 4
        if rem > 0:
            payload += '=' * (4 - rem)
        payload = base64.urlsafe_b64decode(payload.encode('utf-8'))
        return json.loads(payload.decode('utf-8'))
1147862
def userlogin(self, event):
        """"""

        client_uuid = event.clientuuid

        self.log(event.user, pretty=True, lvl=verbose)

        self.log('Adding client')
        self.clients[event.clientuuid] = event.user

        for topic, alert in self.alerts.items():
            self.alert(client_uuid, alert)
1181628
def login_oauth2_user(valid, oauth):
    """"""
    if valid:
        oauth.user.login_via_oauth2 = True
        _request_ctx_stack.top.user = oauth.user
        identity_changed.send(current_app._get_current_object(),
                              identity=Identity(oauth.user.id))
    return valid, oauth
822652
public function loginUsingId($id, $remember = false)
    {
        $this->session->put($this->getName(), $id);

        $user = $this->provider->retrieveById($id);

        $this->login($user, $remember);

        return $user;
    }
279609
def _login(self):
        """"""
        self._sendAction("login", (
            ("Username", self._amiuser),
            ("Secret", self._amipass),
            ("Events", "off"),
        ))
        resp = self._getResponse()
        if resp.get("Response") == "Success":
            return True
        else:
            raise Exception("Authentication to Asterisk Manager Interface Failed.")
531287
def login_with(cls, platform, third_party_auth_data):
        '''
        
        '''
        user = User()
        return user.link_with(platform, third_party_auth_data)
485095
private function _login($id){
    if ( $this->check() && $id ){
      $this
        ->_authenticate($id)
        ->_user_info()
        ->_init_dir(true)
        ->save_session();
    }
    return $this;
  }
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
1227317
def load_logged_in_user():
    """"""
    user_id = session.get("user_id")
    g.user = User.query.get(user_id) if user_id is not None else None
1295630
def login(self, came_from=lurl('/')):
        """"""
        login_counter = request.environ.get('repoze.who.logins', 0)
        if login_counter > 0:
            flash(_('Wrong credentials'), 'warning')
        return dict(page='login', login_counter=str(login_counter),
                    came_from=came_from)
1107931
def login(self):
        """"""
        if self.__logged_in:
            return
        login = {'userId': self.__username, 'userPassword': self.__password}
        header = BASE_HEADERS.copy()
        request = requests.post(BASE_URL + 'login',
                                data=login,
                                headers=header,
                                timeout=10)

        try:
            result = request.json()
        except ValueError as error:
            raise Exception(
                "Not a valid result for login, " +
                "protocol error: " + request.status_code + ' - ' +
                request.reason + "(" + str(error) + ")")

        if 'error' in result.keys():
            raise Exception("Could not login: " + result['error'])

        if request.status_code != 200:
            raise Exception(
                "Could not login, HTTP code: " +
                str(request.status_code) + ' - ' + request.reason)

        if 'success' not in result.keys() or not result['success']:
            raise Exception("Could not login, no success")

        cookie = request.headers.get("set-cookie")
        if cookie is None:
            raise Exception("Could not login, no cookie set")

        self.__cookie = cookie
        self.__logged_in = True
        return self.__logged_in