Creates and sets the authentication string for accessing the reverse
            lookup servlet. No return, the string is set as an attribute to
            the client instance.

        :param username: Username.
        :param password: Password.
1643
def __set_revlookup_auth_string(self, username, password):
        '''
        
        '''
        auth = b2handle.utilhandle.create_authentication_string(username, password)
        self.__revlookup_auth_string = auth
829060
def authenticate(self, username=None, password=None):
        
        data = api_client.authenticate(username, password)
        if not data:
            return

        return User(
            data.get('pk'), data.get('token'), data.get('user_data')
        )
1331769
def password_set(username=None, password=None):
    
    result = keyring.set_password('supernova', username, password)

    # NOTE: keyring returns None when the storage is successful.  That's weird.
    if result is None:
        return True
    else:
        return False
708807
def get_password(self, username, request_url):
        
        content = "%s%s%s" % (username, self.shared_secret, request_url)
        return hashlib.sha256(content.encode('utf8')).hexdigest()
1374276
def create_session(username, password):
    
    user = User.objects.get_user_by_password(username, password)
    auth_session_engine = get_config('auth_session_engine')
    if not user:
        raise InvalidInput('Username or password incorrect')
    session_key = random_string(15)
    while auth_session_engine.get(session_key):
        session_key = random_string(15)
    auth_session_engine.set(session_key, user.username, get_config('auth_session_expire'))
    return {'session_key': session_key, 'user': user}
1171720
public Login login(String username, String password) throws Exception {
    return login(username, password, null);
  }
795547
def encode_basic_auth(username, password):
    
    return "Basic {}".format(
        b64encode(
            "{}:{}".format(
                username,
                password,
            ).encode("utf-8")
        ).decode("utf-8")
    )
957213
def authenticate(self, username=None, password=None, **kwargs):
        
        try:
            user = User.objects.get(email=username)
            if user.check_password(password):
                return user
        except (User.DoesNotExist, User.MultipleObjectsReturned):
            logging.warning('Unsuccessful login attempt using username/email: {0}'.format(username))

        return None
1112438
public ControllerRoute withBasicAuthentication(String username, String password) {
        Objects.requireNonNull(username, Required.USERNAME.toString());
        Objects.requireNonNull(password, Required.PASSWORD.toString());
        
        this.username = username;
        this.password = password;
        
        return this;
    }
432560
def set_password(self, service, username, password):
        
        service = self._safe_string(service)
        username = self._safe_string(username)
        password = self._safe_string(password)
        attrs = GnomeKeyring.Attribute.list_new()
        GnomeKeyring.Attribute.list_append_string(attrs, 'username', username)
        GnomeKeyring.Attribute.list_append_string(attrs, 'service', service)
        GnomeKeyring.Attribute.list_append_string(
            attrs, 'application', 'python-keyring')
        result = GnomeKeyring.item_create_sync(
            self.keyring_name, GnomeKeyring.ItemType.NETWORK_PASSWORD,
            "Password for '%s' on '%s'" % (username, service),
            attrs, password, True)[0]
        if result == GnomeKeyring.Result.CANCELLED:
            # The user pressed "Cancel" when prompted to unlock their keyring.
            raise PasswordSetError("Cancelled by user")
        elif result != GnomeKeyring.Result.OK:
            raise PasswordSetError(result.value_name)
998789
public void setCredentials(String username, String password) {
        this.username = username;
        this.password = password;
    	authorization = "Basic " + Base64.getEncoder().encodeToString(filesystem.getWorld().getSettings().bytes(username + ":" + password));
    }
1161878
async def reset_user_password(self, username):
        
        user_facade = client.UserManagerFacade.from_connection(
            self.connection())
        entity = client.Entity(tag.user(username))
        results = await user_facade.ResetPassword([entity])
        secret_key = results.results[0].secret_key
        return await self.get_user(username, secret_key=secret_key)
205837
def authenticate(self, username, password):
        
        # If username is an email address, then try to pull it up
        user = self.get_by_username_or_email(username)

        if not user:
            return None

        if user.check_password(password):
            return user

        return None
1115577
def with_username(username, password):
    
    user = models.AuthUser.get_by_username(username)
    return _user(user) if user and user.password_matched(password) else None
1092274
def auth(self, username, password):
        
        headers = {
            'Content-type': 'application/json'
        }
        payload = {
            'type': self.auth_type,
            'username': username,
            'password': password
        }
        try:
            full_url = utils.urljoin(self.host, '/api/v1/auth')
            response = requests.post(
                full_url,
                data=json.dumps(payload),
                headers=headers,
                verify=self.tls_verify
            )
        except RequestException:
            raise exceptions.TaigaRestException(
                full_url, 400,
                'NETWORK ERROR', 'POST'
            )
        if response.status_code != 200:
            raise exceptions.TaigaRestException(
                full_url,
                response.status_code,
                response.text,
                'POST'
            )
        self.token = response.json()['auth_token']
        self.raw_request = RequestMaker('/api/v1', self.host, self.token,
                                        'Bearer', self.tls_verify)
        self._init_resources()
406346
def generate_http_basic_token(username, password):
    
    token = base64.b64encode('{}:{}'.format(username, password).encode('utf-8')).decode('utf-8')
    return token
225885
public T authentication(String username, String password) {
        return authentication(username, password, false);
    }