Login to anaconda cloud.
779806
def login(self, username, password, application, application_url):
        """"""
        logger.debug(str((username, application, application_url)))
        method = self._anaconda_client_api.authenticate
        return self._create_worker(method, username, password, application,
                                   application_url)
858710
def login(self, username=None, password=None):
        """"""
        if username is not None:
            self._username = username
        if password is not None:
            self._password = password

        if self._username is None or not isinstance(self._username, str):
            raise SkybellAuthenticationException(ERROR.USERNAME)

        if self._password is None or not isinstance(self._password, str):
            raise SkybellAuthenticationException(ERROR.PASSWORD)

        self.update_cache(
            {
                CONST.ACCESS_TOKEN: None
            })

        login_data = {
            'username': self._username,
            'password': self._password,
            'appId': self.cache(CONST.APP_ID),
            CONST.TOKEN: self.cache(CONST.TOKEN)
        }

        try:
            response = self.send_request('post', CONST.LOGIN_URL,
                                         json_data=login_data, retry=False)
        except Exception as exc:
            raise SkybellAuthenticationException(ERROR.LOGIN_FAILED, exc)

        _LOGGER.debug("Login Response: %s", response.text)

        response_object = json.loads(response.text)

        self.update_cache({
            CONST.ACCESS_TOKEN: response_object[CONST.ACCESS_TOKEN]})

        _LOGGER.info("Login successful")

        return True
700776
def login(request):
    """"""
    email = verify_login(request)
    request.response.headers.extend(remember(request, email))
    return {'redirect': request.POST.get('came_from', '/'), 'success': True}
784381
def write_login(collector, image, **kwargs):
    """"""
    docker_api = collector.configuration["harpoon"].docker_api
    collector.configuration["authentication"].login(docker_api, image, is_pushing=True, global_docker=True)
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)
757477
def login(self, email=None, password=None, timeout=5):
        """"""
        if email is not None:
            self.email = email
        if password is not None:
            self.password = password

        url = self.api_url + API_LOGIN_ENDPOINT
        data = json.dumps({'email': self.email, 'password': self.password})
        headers = {'Content-Type': 'application/json'}
        response = None

        try:
            response = self.session.post(url, data=data, headers=headers,
                                         timeout=timeout)
        except requests.exceptions.ConnectionError:
            _LOGGER.warning("Unable to connect to %s", url)
        except requests.exceptions.Timeout:
            _LOGGER.warning("No response from %s", url)

        if response is not None:
            if response.status_code == 200:
                self.auth_token = json.loads(response.text)['authorization']
                return True
            else:
                _LOGGER.warning("Login failed for %s: %s", self.email,
                                response.text)
        else:
            _LOGGER.warning("Login failed for %s", self.email)

        return False
292575
def login(container):
    """"""
    columns, lines = shutil.get_terminal_size()  # Temporary
    try:
        subprocess.check_call([
            "docker", "exec",
            "--env", f"COLUMNS={str(columns)},LINES={str(lines)}",  # Temporary
            "--env", f"LINES={str(lines)}",  # Temporary
            "--interactive",
            "--tty",
            container,
            "bash",
            "--login"
        ])
    except subprocess.CalledProcessError:
        raise RuntimeError() from None
220842
def setup(cli):
    """"""
    if not cli.global_config.loaded:
        setup_dotcloud_account(cli)
    discover_satellite(cli)
    cli.success("Skypipe is ready for action")
480206
def show():
    
    utils.check_for_cloud_server()
    click.echo("Using cloud server at \"{}\"".format(
        config["cloud_server"]["url"]
    ))
    if config["cloud_server"]["username"]:
        click.echo(
            "Logged in as user \"{}\"".format(config["cloud_server"]["username"])
        )
    if config["cloud_server"]["farm_name"]:
        click.echo(
            "Using farm \"{}\"".format(config["cloud_server"]["farm_name"])
        )
1309679
def login(config, username=None, password=None, email=None, url=None, client=None, *args, **kwargs):
    '''
    
    '''
    try:
        c = (_get_client(config) if not client else client)
        lg = c.login(username, password, email, url)
        print "%s logged to %s"%(username,(url if url else "default hub"))
    except Exception as e:
        utils.error("%s can't login to repo %s: %s"%(username,(url if url else "default repo"),e))
        return False
    return True
699531
def login(self, schema, username, password):
        
        self.schema = schema
        self.username = username
        self.password = password
        self.connection = schema
1258962
def login(ctx):
    """"""
    base_url = os.environ.get("ONE_CODEX_API_BASE", "https://app.onecodex.com")
    if not ctx.obj["API_KEY"]:
        _login(base_url)
    else:
        email = _login(base_url, api_key=ctx.obj["API_KEY"])
        ocx = Api(api_key=ctx.obj["API_KEY"], telemetry=ctx.obj["TELEMETRY"])

        # TODO: This should be protected or built in as a first class resource
        # with, e.g., connection error catching (it's not part of our formally documeted API at the moment)
        if ocx._client.Account.instances()["email"] != email:
            click.echo("Your login credentials do not match the provided email!", err=True)
            _remove_creds()
            ctx.exit(1)
497005
def _login(self, environ, start_response):
        """"""
        response = HTTPUnauthorized()
        response.www_authenticate = ('Basic', {'realm': self._realm})
        return response(environ, start_response)
1111577
def login(self):
        """"""
        self._username = input("Username:")
        self._password = getpass.getpass("Password:")
        if self.get_auth_token():
            _LOGGER.debug("Login successful!")
            return True
        _LOGGER.warning("Unable to login with %s.", self._username)
        return False
206767
def login(self, username, password):
        
        r0 = self.req(API_HOME)
        time.sleep(1)
        cookies = dict(r0.cookies)
        data = {
            'source': 'index_nav',
            'form_email': username,
            'form_password': password,
            'remember': 'on',
        }
        r1 = self.req(API_ACCOUNT_LOGIN, method='post', data=data)
        cookies.update(dict(r1.cookies))
        [cookies.update(dict(r.cookies)) for r in r1.history]
        if 'dbcl2' not in cookies:
            raise Exception('Authorization failed for <%s>: %s' % (username, r1.url))
        cookies.update(dict(r1.cookies))
        self.logger.info('login with username <%s>' % username)
        self.use(cookies)
        return self
531130
def _authenticate():
    '''
    
    '''
    global url, port, ticket, csrf, verify_ssl
    url = config.get_cloud_config_value(
        'url', get_configured_provider(), __opts__, search_global=False
    )
    port = config.get_cloud_config_value(
        'port', get_configured_provider(), __opts__,
        default=8006, search_global=False
    )
    username = config.get_cloud_config_value(
        'user', get_configured_provider(), __opts__, search_global=False
    ),
    passwd = config.get_cloud_config_value(
        'password', get_configured_provider(), __opts__, search_global=False
    )
    verify_ssl = config.get_cloud_config_value(
        'verify_ssl', get_configured_provider(), __opts__,
        default=True, search_global=False
    )

    connect_data = {'username': username, 'password': passwd}
    full_url = 'https://{0}:{1}/api2/json/access/ticket'.format(url, port)

    returned_data = requests.post(
        full_url, verify=verify_ssl, data=connect_data).json()

    ticket = {'PVEAuthCookie': returned_data['data']['ticket']}
    csrf = six.text_type(returned_data['data']['CSRFPreventionToken'])
1358576
def authenticate(self):
        

        config_data = {}

        # Step 1: try getting username/password from environment
        config_data = self.read_config_environment(config_data)

        # Step 2: if credentials were not in env read in configuration file
        if self.CONFIG_NAME_USER not in config_data \
                or self.CONFIG_NAME_KEY not in config_data:
            if os.path.exists(self.config):
                config_data = self.read_config_file(config_data)
            else:
                raise IOError('Could not find {}. Make sure it\'s located in'
                              ' {}. Or use the environment method.'.format(
                                  self.config_file, self.config_dir))

        # Step 3: load into configuration!
        self._load_config(config_data)