Blob Blame History Raw
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>org.freedesktop.Problems2.Session</title><link rel="stylesheet" type="text/css" href="style.css"><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot"><link rel="home" href="index.html" title="Problems API"><link rel="up" href="ch02.html" title="Chapter 2. Interfaces"><link rel="prev" href="re02.html" title="org.freedesktop.Problems2.Entry"><link rel="next" href="re04.html" title="org.freedesktop.Problems2.Task"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">
          <code class="literal">org.freedesktop.Problems2.Session</code>
        </th></tr><tr><td width="20%" align="left"><a accesskey="p" href="re02.html">Prev</a> </td><th width="60%" align="center">Chapter 2. Interfaces</th><td width="20%" align="right"> <a accesskey="n" href="re04.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="org.freedesktop.Problems2.Session"></a><div class="titlepage"></div><div class="refnamediv"><h2><span class="refentrytitle">
          <code class="literal">org.freedesktop.Problems2.Session</code>
        </span></h2><p>org.freedesktop.Problems2.Session — Session objects hold information about identity of clients. A session object is created automatically when a new client makes connection. Clients are treated as an anonymous users until they are authorized in 'Authorize' method.</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="refsect2"><a name="methods"></a><h3>Methods</h3><div class="funcsynopsis"><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">
                <b class="fsfunc">Authorize</b>
              (</code></td><td>IN Dict&lt;String,Variant&gt; <var class="pdparam">parameters</var>, </td></tr><tr><td> </td><td>OUT Int32 <var class="pdparam">result</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">
                <b class="fsfunc">RevokeAuthorization</b>
              (</code></td><td><code>void)</code>;</td><td> </td></tr></table><div class="funcprototype-spacer"> </div><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">
                <b class="fsfunc">GenerateToken</b>
              (</code></td><td>IN UInt32 <var class="pdparam">period</var>, </td></tr><tr><td> </td><td>OUT String <var class="pdparam">token</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">
                <b class="fsfunc">RevokeToken</b>
              (</code></td><td>IN String <var class="pdparam">token</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect2"><a name="signals"></a><h3>Signals</h3><div class="funcsynopsis"><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">
                <b class="fsfunc">AuthorizationChanged</b>
              (</code></td><td>OUT Int32 <var class="pdparam">status</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect2"><a name="properties"></a><h3>Properties</h3><div class="refsynopsisdiv"><h2></h2><code class="fieldsynopsis"><span class="modifier">READ </span><span class="type">Boolean </span><span class="varname">IsAuthorized </span>;</code></div></div></div><div class="refsection"><a name="methods"></a><h2>Methods</h2><div class="refsection"><a name="org.freedesktop.Problems2.Session.Authorize"></a><h3>
            <code class="literal">org.freedesktop.Problems2.Session.Authorize</code>
          </h3><div class="funcsynopsis"><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">
                <b class="fsfunc">Authorize</b>
              (</code></td><td>IN Dict&lt;String,Variant&gt; <var class="pdparam">parameters</var>, </td></tr><tr><td> </td><td>OUT Int32 <var class="pdparam">result</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div><p>The method authorizes the client for access to all problems. The method returns immediately and the authorization results are reported through AuthorizationChanged signal.</p><div class="glosslist"><dl><dt><span class="glossterm">
                <code class="literal">parameters</code>
              </span></dt><dd class="glossdef"><p>Additional parameters that can be used for granting authorization:
                        </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">problems2.peer-token</span></dt><dd><p>Secret token of the peer's session.</p></dd><dt><span class="term">problems2.peer-bus</span></dt><dd><p>Unique bus name of the Session that generated the token.</p></dd></dl></div><p>
                    </p></dd><dt><span class="glossterm">
                <code class="literal">result</code>
              </span></dt><dd class="glossdef"><p>
                        </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">-1</span></dt><dd><p>An error occurred</p></dd><dt><span class="term">0</span></dt><dd><p>The authorization request has succeeded and the client is now authorized.</p></dd><dt><span class="term">1</span></dt><dd><p>The authorization request has been accepted.</p></dd><dt><span class="term">2</span></dt><dd><p>The previous authorization request is not finished yet.</p></dd></dl></div><p>
                    </p></dd></dl></div></div><div class="refsection"><a name="org.freedesktop.Problems2.Session.RevokeAuthorization"></a><h3>
            <code class="literal">org.freedesktop.Problems2.Session.RevokeAuthorization</code>
          </h3><div class="funcsynopsis"><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">
                <b class="fsfunc">RevokeAuthorization</b>
              (</code></td><td><code>void)</code>;</td><td> </td></tr></table><div class="funcprototype-spacer"> </div></div><p>Disposes the current session object and drops all authorization tokens. If the client makes a further action, a new session object on the same path will be created.</p></div><div class="refsection"><a name="org.freedesktop.Problems2.Session.GenerateToken"></a><h3>
            <code class="literal">org.freedesktop.Problems2.Session.GenerateToken</code>
          </h3><div class="funcsynopsis"><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">
                <b class="fsfunc">GenerateToken</b>
              (</code></td><td>IN UInt32 <var class="pdparam">period</var>, </td></tr><tr><td> </td><td>OUT String <var class="pdparam">token</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div><p>This methods generates a string that can be used by another Session for authorization without prompting for password. The token can be used only once and only by the same user as the one that owns the Session object that generated the token. The token remains valid for a limited period of time. The method will fail if called on a Session object that is not authorize yet. In case the token will not be used, the token can be revoked by RevokeToken method. The method can be called only on a Session that is currently authorized.</p><div class="glosslist"><dl><dt><span class="glossterm">
                <code class="literal">period</code>
              </span></dt><dd class="glossdef"><p>This argument defines the validity period of time in seconds. 0 is interpreted as default which may vary between implementations (~5s).</p></dd><dt><span class="glossterm">
                <code class="literal">token</code>
              </span></dt><dd class="glossdef"><p>A string that should be passed as the value of the 'parent-token' key in the Authorize method's 'parameters' argument.</p></dd></dl></div></div><div class="refsection"><a name="org.freedesktop.Problems2.Session.RevokeToken"></a><h3>
            <code class="literal">org.freedesktop.Problems2.Session.RevokeToken</code>
          </h3><div class="funcsynopsis"><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">
                <b class="fsfunc">RevokeToken</b>
              (</code></td><td>IN String <var class="pdparam">token</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div><p>In case a token is no longer needed. This method can be used to revoke a generated token.</p><div class="glosslist"><dl><dt><span class="glossterm">
                <code class="literal">token</code>
              </span></dt><dd class="glossdef"><p>Token string returned by GenerateToken method.</p></dd></dl></div></div></div><div class="refsection"><a name="signals"></a><h2>Signals</h2><div class="refsection"><a name="org.freedesktop.Problems2.Session.AuthorizationChanged"></a><h3>
            <code class="literal">org.freedesktop.Problems2.Session.AuthorizationChanged</code>
          </h3><div class="funcsynopsis"><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">
                <b class="fsfunc">AuthorizationChanged</b>
              (</code></td><td>OUT Int32 <var class="pdparam">status</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div><p>Notifies the changes of state of authorization.</p><div class="glosslist"><dl><dt><span class="glossterm">
                <code class="literal">status</code>
              </span></dt><dd class="glossdef"><p>Describes the change that happened and can be one of the following values:
                        </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">0</span></dt><dd><p>The recent authorization request has succeeded and the client is now authorized.</p></dd><dt><span class="term">1</span></dt><dd><p>Authorization request is pending.</p></dd><dt><span class="term">2</span></dt><dd><p>Authorization has been lost.</p></dd><dt><span class="term">3</span></dt><dd><p>Authorization request has failed.</p></dd></dl></div><p>
                    </p></dd></dl></div></div></div><div class="refsection"><a name="dbus_properties"></a><h2>D-Bus Properties</h2><p>
            Accessed using the org.freedesktop.DBus.Properties interface.
          </p><code class="fieldsynopsis"><span class="modifier">READ </span><span class="type">Boolean </span><span class="varname">IsAuthorized </span>;</code><p>TRUE if the client is authorized; otherwise FALSE.</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="re02.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch02.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="re04.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">
          <code class="literal">org.freedesktop.Problems2.Entry</code>
         </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 
          <code class="literal">org.freedesktop.Problems2.Task</code>
        </td></tr></table></div></body></html>