Exemplo n.º 1
0
def login():
    print("Enter your Ubuntu One SSO credentials.")
    email = input("Email: ")
    password = getpass.getpass("Password: "******"One-time password (just press enter if you don't use " "two-factor authentication): ")

    logger.info("Authenticating against Ubuntu One SSO.")
    response = storeapi.login(email, password, token_name="snapcraft", otp=otp)
    success = response.get("success", False)

    if success:
        save_config(response["body"])
        logger.info("Login successful.")
    else:
        logger.info("Login failed.")
Exemplo n.º 2
0
def login():
    print('Enter your Ubuntu One SSO credentials.')
    email = input('Email: ')
    password = getpass.getpass('Password: '******'One-time password (just press enter if you don\'t use '
                'two-factor authentication): ')

    logger.info('Authenticating against Ubuntu One SSO.')
    response = storeapi.login(email, password, token_name='snapcraft', otp=otp)
    success = response.get('success', False)

    if success:
        save_config(response['body'])
        logger.info('Login successful.')
    else:
        logger.info('Login failed.')
Exemplo n.º 3
0
def main(argv=None):
    """Authenticates session against Ubuntu One SSO."""
    argv = argv if argv else []
    docopt(__doc__, argv=argv)

    print('Enter your Ubuntu One SSO credentials.')
    email = input('Email: ')
    password = getpass.getpass('Password: '******'OTP: ')

    logger.info('Authenticating against Ubuntu One SSO.')
    response = login(email, password, token_name='snapcraft', otp=otp)
    success = response.get('success', False)

    if success:
        save_config(response['body'])
        logger.info('Login successful.')
    else:
        logger.info('Login failed.')
Exemplo n.º 4
0
def main(argv=None):
    """Authenticates session against Ubuntu One SSO."""
    argv = argv if argv else []
    docopt(__doc__, argv=argv)

    print('Enter your Ubuntu One SSO credentials.')
    email = input('Email: ')
    password = getpass.getpass('Password: '******'One-time password (just press enter if you don\'t use '
                'two-factor authentication): ')

    logger.info('Authenticating against Ubuntu One SSO.')
    response = login(email, password, token_name='snapcraft', otp=otp)
    success = response.get('success', False)

    if success:
        save_config(response['body'])
        logger.info('Login successful.')
    else:
        logger.info('Login failed.')