solvebio/cli/auth.py
def _ask_for_credentials():
    """
    Asks the user for their email and password.
    """
    _print_msg('Please enter your SolveBio credentials')
    domain = raw_input('Domain (e.g. <domain>.solvebio.com): ')
    # Check to see if this domain supports password authentication
    try:
        account = client.request('get', '/p/accounts/{}'.format(domain))
        auth = account['authentication']
    except:
        raise SolveError('Invalid domain: {}'.format(domain))

    # Account must support password-based login
    if auth.get('login') or auth.get('SAML', {}).get('simple_login'):
        email = raw_input('Email: ')
        password = getpass.getpass('Password (typing will be hidden): ')
        return (domain, email, password)
    else:
        _print_msg(
            'Your domain uses Single Sign-On (SSO). '
            'Please visit https://{}.solvebio.com/settings/security '
            'for instructions on how to log in.'.format(domain))
        sys.exit(1)
def _ask_for_credentials():
    """
    Asks the user for their email and password.
    """
    _print_msg('Please enter your SolveBio credentials')
    domain = raw_input('Domain (e.g. <domain>.solvebio.com): ')
    # Check to see if this domain supports password authentication
    try:
        account = client.request('get', '/p/accounts/{}'.format(domain))
        auth = account['authentication']
    except:
        raise SolveError('Invalid domain: {}'.format(domain))

    # Account must support password-based login
    if auth.get('login') or auth.get('SAML', {}).get('simple_login'):
        email = raw_input('Email: ')
        password = getpass.getpass('Password (typing will be hidden): ')
        return (domain, email, password)
    else:
        _print_msg(
            'Your domain uses Single Sign-On (SSO). '
            'Please visit https://{}.solvebio.com/settings/security '
            'for instructions on how to log in.'.format(domain))
        sys.exit(1)
def _ask_for_credentials ( ) : _print_msg ( 'Please enter your SolveBio credentials' ) domain = raw_input ( 'Domain (e.g. <domain>.solvebio.com): ' ) # Check to see if this domain supports password authentication try : account = client . request ( 'get' , '/p/accounts/{}' . format ( domain ) ) auth = account [ 'authentication' ] except : raise SolveError ( 'Invalid domain: {}' . format ( domain ) ) # Account must support password-based login if auth . get ( 'login' ) or auth . get ( 'SAML' , { } ) . get ( 'simple_login' ) : email = raw_input ( 'Email: ' ) password = getpass . getpass ( 'Password (typing will be hidden): ' ) return ( domain , email , password ) else : _print_msg ( 'Your domain uses Single Sign-On (SSO). ' 'Please visit https://{}.solvebio.com/settings/security ' 'for instructions on how to log in.' . format ( domain ) ) sys . exit ( 1 )
Asks the user for their email and password.
Asks the user for their email and password .