Gio.DBusConnection.get_peer_credentials

### Method

# Gio DBusConnectionget_peer_credentials

since: 2.26

#### Declaration [src]

    GCredentials*
    g_dbus_connection_get_peer_credentials (
      GDBusConnection* connection
    )

#### Description [src]

Gets the credentials of the authenticated peer. This will always return `NULL` unless `connection` acted as a server (e.g. `G_DBUS_CONNECTION_FLAGS_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.

Available since: 2.26

#### Return value

Type: `GCredentials`

A `GCredentials` or `NULL` if not available. Do not free this object, it is owned by `connection`.

The returned data is owned by the instance.
The return value can be `NULL`.