How to save password for Gtk client

Well this will not be safe storing in clear text password in a configuration file.
But I think it will be doable to create plugins that enhance the login process (like Connect Tryton to Gluu using oxd-server). Such plugin could request password from password manager and automatically fill the entry.