manpagez: man pages & more
html files: PolicyKit
Home | html | info | man

Authentication Agent

To gain authorizations through authentication, an Authentication Agent is used. The section defines an abstract interface that applications can use to interact with such an agent. This allows different desktop environments to implement different agents with native look and feel.

The interface is quite simple. Basically, a PolicyKit Authentication Agent must provide the D-Bus session service with the unique name org.freedesktop.PolicyKit.AuthenticationAgent that exposes a single object with the path / that exports the org.freedesktop.PolicyKit.AuthenticationAgent D-Bus interface. The interface is defined by the following D-Bus introspection data:

<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" 

<!-- This file is provided by the PolicyKit project -->

  <interface name="org.freedesktop.PolicyKit.AuthenticationAgent">

    <method name="ObtainAuthorization">
      <!-- IN: PolicyKit action identifier; see PolKitAction -->
      <arg name="action_id" direction="in" type="s"/>

      <!-- IN: X11 window ID for the top-level X11 window the dialog will be transient for (pass zero if no window) -->
      <arg name="xid" direction="in" type="u"/>

      <!-- IN: Process ID to grant authorization to -->
      <arg name="pid" direction="in" type="u"/>

      <!-- OUT: whether the user gained the authorization -->
      <arg name="gained_authorization" direction="out" type="b"/>


This file is available as /usr/share/dbus-1/interfaces/org.freedesktop.PolicyKit.AuthenticationAgent.xml on a system with PolicyKit development packages installed. It can be used to generating client glue code.

© 2000-2022
Individual documents may contain additional copyright information.