Commit f665c1de authored by Felipe Borges's avatar Felipe Borges 👣 Committed by Felipe Borges

rdp-display: Handle authentication requests

By implementing Frdp.Display.authenticate we are able to chain up
the passing of credentials from Boxes to Gtk-frdp to freerdp.
parent e6088aea
......@@ -2,10 +2,20 @@
using Gtk;
using Frdp;
private class Boxes.FrdpDisplay: Frdp.Display {
public override bool authenticate (out string username, out string password, out string domain) {
username = this.username;
password = this.password;
domain = null;
return true;
}
}
private class Boxes.RdpDisplay: Boxes.Display {
public override string protocol { get { return "RDP"; } }
public override string? uri { owned get { return @"rdp://$host:$port"; } }
private Frdp.Display display;
private FrdpDisplay display;
private string host;
private int port;
private BoxConfig.SavedProperty[] saved_properties;
......@@ -14,9 +24,9 @@
saved_properties = {
BoxConfig.SavedProperty () { name = "read-only", default_value = false }
};
need_password = false;
display = new Frdp.Display ();
display = new FrdpDisplay ();
display.bind_property ("username", this, "username", BindingFlags.BIDIRECTIONAL);
display.bind_property ("password", this, "password", BindingFlags.BIDIRECTIONAL);
display.rdp_connected.connect (() => {
show (0);
......@@ -26,6 +36,12 @@
hide (0);
access_finish ();
});
display.rdp_needs_authentication.connect (() => {
need_username = true;
need_password = true;
display.close ();
});
}
public RdpDisplay (BoxConfig config, string host, int port) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment