def register_new_user(username, server_name): certs_home = os.path.abspath(os.path.join(os.path.abspath(__file__), "..", "..", "certificates")) config = LeapConfig(certs_home=certs_home) provider = LeapProvider(server_name, config) password = getpass.getpass('Please enter password for %s: ' % username) LeapAuthenticator(provider).register(LeapCredentials(username, password)) session = LeapSession.open(username, password, server_name) session.nicknym.generate_openpgp_key()
def init_leap_session(app): try: leap_session = LeapSession.open(app.config['LEAP_USERNAME'], app.config['LEAP_PASSWORD'], app.config['LEAP_SERVER_NAME']) except ConnectionError, error: print("Can't connect to the requested provider") sys.exit(1)
def register_new_user(username, server_name): config = LeapConfig() provider = LeapProvider(server_name, config) password = getpass.getpass('Please enter password for %s: ' % username) LeapAuthenticator(provider).register(LeapCredentials(username, password)) session = LeapSession.open(username, password, server_name) session.nicknym.generate_openpgp_key()
def register_new_user(username, server_name): config = LeapConfig() provider = LeapProvider(server_name, config) password = getpass.getpass('Please enter password for %s: ' % username) srp_auth = SRPAuth(provider.api_uri, provider.local_ca_crt) srp_auth.register(username, password) session = LeapSession.open(username, password, server_name) session.nicknym.generate_openpgp_key()
def register_new_user(username, server_name): certs_home = os.path.abspath( os.path.join(os.path.abspath(__file__), "..", "..", "certificates")) config = LeapConfig(certs_home=certs_home) provider = LeapProvider(server_name, config) password = getpass.getpass('Please enter password for %s: ' % username) LeapAuthenticator(provider).register(LeapCredentials(username, password)) session = LeapSession.open(username, password, server_name) session.nicknym.generate_openpgp_key()