예제 #1
0
 def login(self, app_name, args):
     """Get credentials if found else prompt GUI to login."""
     self.ref_count += 1
     obj = Credentials(app_name, **self._parse_args(args))
     d = obj.login()
     d.addCallback(lambda creds: self.CredentialsFound(app_name, creds))
     d.addErrback(self._process_failures, app_name)
예제 #2
0
 def login(self, app_name, args):
     """Get credentials if found else prompt GUI to login."""
     self.ref_count += 1
     obj = Credentials(app_name, **self._parse_args(args))
     d = obj.login()
     d.addCallback(lambda creds: self.CredentialsFound(app_name, creds))
     d.addErrback(self._process_failures, app_name)
예제 #3
0
    def login_to_get_credentials(self, app_name, help_text, window_id,
                                 success_cb, error_cb, denial_cb,
                                 ui_module='ubuntu_sso.gtk.gui'):
        """Get credentials if found else prompt GUI just to login

        'app_name' will be displayed in the GUI.
        'help_text' is an explanatory text for the end-users, will be shown
         before the login fields.
        'window_id' is the id of the window which will be set as a parent of
         the GUI. If 0, no parent will be set.

        """
        ping_url = self.ping_url if app_name == U1_APP_NAME else None
        obj = Credentials(app_name=app_name, ping_url=ping_url, tc_url=None,
                          help_text=help_text, window_id=window_id,
                          success_cb=success_cb, error_cb=error_cb,
                          denial_cb=denial_cb, ui_module=ui_module)
        obj.login()
예제 #4
0
    def login_email_password(self, app_name, args):
        """Get credentials if found else try to login.

        Login will be done by inspecting 'args' and expecting to find two keys:
        'email' and 'password'.

        """
        self.ref_count += 1
        email = args.pop('email')
        password = args.pop('password')
        obj = Credentials(app_name, **self._parse_args(args))
        d = obj.login(email=email, password=password)
        d.addCallback(lambda creds: self.CredentialsFound(app_name, creds))
        d.addErrback(self._process_failures, app_name)
예제 #5
0
    def login_email_password(self, app_name, args):
        """Get credentials if found else try to login.

        Login will be done by inspecting 'args' and expecting to find two keys:
        'email' and 'password'.

        """
        self.ref_count += 1
        email = args.pop('email')
        password = args.pop('password')
        obj = Credentials(app_name, **self._parse_args(args))
        d = obj.login(email=email, password=password)
        d.addCallback(lambda creds: self.CredentialsFound(app_name, creds))
        d.addErrback(self._process_failures, app_name)
예제 #6
0
 def login(self, app_name, args):
     """Get credentials if found else prompt GUI to login."""
     self.ref_count += 1
     obj = Credentials(app_name, **self._parse_args(args))
     obj.login()