Gio.DBusConnection.prototype.get_peer_credentials

function get_peer_credentials(): Gio.Credentials {
    // Gjs wrapper for g_dbus_connection_get_peer_credentials()
}
  

Gets the credentials of the authenticated peer. This will always return null unless connection acted as a server (e.g. Gio.DBusConnectionFlags.authentication_server was passed) when set up and the client passed credentials as part of the authentication process.

In a message bus setup, the message bus is always the server and each application is a client. So this method will always return null for message bus clients.

Since 2.26

Returns

a Gio.Credentials or null if not available. Do not free this object, it is owned by connection.