def f(): """Inner function that will be run in a thread.""" token_name = get_token_name(app_name) logger.debug('login: token_name %r, email %r, password <hidden>.', token_name, email) credentials = self.processor.login(email, password, token_name) logger.debug('login returned not None credentials? %r.', credentials is not None) return credentials
def validate_email(self, app_name, email, password, email_token, ping_url=None): """Call the matching method in the processor.""" try: token_name = get_token_name(app_name) credentials = yield self.processor.validate_email(email, password, email_token, token_name) yield self._process_new_token(app_name, email, credentials, ping_url) self.EmailValidated(app_name, email) except Exception as e: self.EmailValidationError(app_name, e)
def validate_email(self, app_name, email, password, email_token, ping_url=None): """Call the matching method in the processor.""" try: token_name = get_token_name(app_name) credentials = yield self.processor.validate_email( email, password, email_token, token_name) yield self._process_new_token(app_name, email, credentials, ping_url) self.EmailValidated(app_name, email) except Exception as e: self.EmailValidationError(app_name, e)
def login(self, app_name, email, password, ping_url=None): """Call the matching method in the processor.""" try: token_name = get_token_name(app_name) logger.debug('login: token_name %r, email %r, password <hidden>.', token_name, email) credentials = yield self.processor.login(email, password, token_name) logger.debug('login returned not None credentials? %r.', credentials is not None) is_validated = yield self.processor.is_validated(credentials) logger.debug('user is validated? %r.', is_validated) if is_validated: yield self._process_new_token(app_name, email, credentials, ping_url) self.LoggedIn(app_name, email) else: self.UserNotValidated(app_name, email) except Exception as e: self.LoginError(app_name, e)
def login(self, app_name, email, password, ping_url=None): """Call the matching method in the processor.""" try: token_name = get_token_name(app_name) logger.debug('login: token_name %r, email %r, password <hidden>.', token_name, email) credentials = yield self.processor.login(email, password, token_name) logger.debug('login returned not None credentials? %r.', credentials is not None) is_validated = yield self.processor.is_validated(credentials) logger.debug('user is validated? %r.', is_validated) if is_validated: yield self._process_new_token(app_name, email, credentials, ping_url) self.LoggedIn(app_name, email) else: self.UserNotValidated(app_name, email) except Exception as e: self.LoginError(app_name, e)
def _get_keyring_attr(self, app_name): """Build the keyring attributes for this credentials.""" attr = {"key-type": "Ubuntu SSO credentials", "token-name": get_token_name(app_name)} return attr
def f(): """Inner function that will be run in a thread.""" token_name = get_token_name(app_name) credentials = self.processor.validate_email(email, password, email_token, token_name) return credentials