def authenticate_me(self, **kwargs): connection_info = 'https://data.kitware.com/api/v1' username = kwargs['username'] password = kwargs['password'] try: gc = girder_client.GirderClient(apiUrl=connection_info) gc.authenticate(username, password) db = get_db() with db_session: p = db.Providers.select().filter(provider=self.name).first() provider_metadata = { 'provider': self.name, 'username': username, 'password': password, } if p is None: db.Providers(**provider_metadata) else: p.set(**provider_metadata) return True except: log.error( "Either credentials invalid or unable to connect to the Girder live server." ) return False
def authenticate_me(self, **kwargs): username = input("Enter Username: "******"Enter Password: "******"Either credentials invalid or unable to connect to HydroShare." ) return False
def authenticate_me(self, **kwargs): username = kwargs.get('username') or input("Enter Username: "******"Enter Password: "******"Either credentials invalid or unable to connect to {}.". format(self.name)) return False