Flatpack: Retrieve credentials from host EDS

Hi there :wave:,

At elementary we ran into some problems with app using EDS which are packaged as Flatpack: We have EDS installed on the host system which can be configured through the elementary System Settings > Online Accounts.

Then there is the EDS library packaged within the Flatpack apps such as elementary Tasks, Mail and Calendar. We now try to retrieve the credentials configured in the host EDS from Flatpack with the following code:

var credentials_provider = new E.SourceCredentialsProvider (registry);
E.NamedParameters credentials;
credentials_provider.lookup_sync (collection_source, null, out credentials);

But unfortunately this does not seem to be passed through the host system as it does not return any credentials. Therefore we assume the call keeps stuck within Flatpack.

Is there an existing way to do this?

See Provide way for Flatpak to retrieve credentials · Issue #209 · elementary/switchboard-plug-onlineaccounts · GitHub for more information.

In the past in gnome various apps were using e-d-s from host but most of the switched to using a sandboxed instance from inside the runtime since that’s guaranted to work regardless of the distro.

So I don’t think you will find many apps exposing the host eds and so you will have to test and figure out how it works exactly on your own. But you can start by looking at older commits of various gnome modules like here

try adding these to the finish args and see if it works. Most likely that you will have to check the method names
still match with what e-d-s on Elementary OS 6 exports. Also should probably fix it such that the Elementary runtime and the host offer the same version of eds, mind filling an issue for that in the elementary flatpak repo?

        "--talk-name=org.gnome.OnlineAccounts",
        "--talk-name=org.gnome.evolution.dataserver.AddressBook9",
        "--talk-name=org.gnome.evolution.dataserver.Calendar7",
        "--talk-name=org.gnome.evolution.dataserver.Sources5",
        "--talk-name=org.gnome.evolution.dataserver.Subprocess.Backend.*",

Thanks for the hints @alatiera!

In the past in gnome various apps were using e-d-s from host but most of the switched to using a sandboxed instance from inside the runtime since that’s guaranted to work regardless of the distro.

From what I understand that’s exactly what we are trying to achieve for elementary as well. What I don’t understand is, how does GNOME handle credentials today? There is GNOME Online Accounts - so I assume configuring the account happens outside of the sandboxed app, right? How does the sandboxed app retrieve this information?

How does the sandboxed app retrieve this information?

They can’t access e-d-s on the host so each gnome app is running its own isolated e-d-s instance and they don’t share data. What you ideally want for elementary is the opposite, every system applications being able to use the e-d-s from the host and share the configuration and data.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.