Fixed password auth & added TLS/x509 credential

This commit is contained in:
Daniel P. Berrange 2007-08-28 22:17:56 -04:00
parent a2ea70a451
commit a4ffca39a1

View File

@ -305,19 +305,23 @@ class vmmConsole(gobject.GObject):
logging.error(details) logging.error(details)
def set_password(self, src=None): def set_password(self, src=None):
logging.debug("Setting a password to " . str(src.get_text())) txt = self.window.get_widget("console-auth-password")
logging.debug("Setting a password to " + str(txt.get_text()))
self.vncViewer.set_credential(gtkvnc.CREDENTIAL_PASSWORD, src.get_text()) self.vncViewer.set_credential(gtkvnc.CREDENTIAL_PASSWORD, txt.get_text())
def _vnc_auth_credential(self, src, type): def _vnc_auth_credential(self, src, credList):
logging.debug("Got credential request %d", type) for i in range(len(credList)):
if type != gtkvnc.CREDENTIAL_PASSWORD: logging.debug("Got credential request %s", str(credList[i]))
# Force it to stop re-trying if credList[i] == gtkvnc.CREDENTIAL_PASSWORD:
self.vncViewerFailures = 10 self.activate_auth_page()
self.vncViewer.close() elif credList[i] == gtkvnc.CREDENTIAL_CLIENTNAME:
return self.vncViewer.set_credential(credList[i], "libvirt")
else:
self.activate_auth_page() # Force it to stop re-trying
self.vncViewerFailures = 10
self.vncViewer.close()
self.activate_unavailable_page(_("Unsupported console authentication type"))
def activate_unavailable_page(self, msg): def activate_unavailable_page(self, msg):
self.window.get_widget("console-pages").set_current_page(PAGE_UNAVAILABLE) self.window.get_widget("console-pages").set_current_page(PAGE_UNAVAILABLE)