`org.freedesktop.Problems2.Session`
Prev | Chapter 2. Interfaces | Next

## `org.freedesktop.Problems2.Session`

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.

## Synopsis

### Methods

`Authorize (` | IN Dict<String,Variant> parameters,
| OUT Int32 result`)`;

`RevokeAuthorization (` | `void)`; |

`GenerateToken (` | IN UInt32 period,
| OUT String token`)`;

`RevokeToken (` | IN String token`)`;

### Signals

`AuthorizationChanged (` | OUT Int32 status`)`;

### Properties

##

`READ Boolean IsAuthorized ;`

## Methods

### `org.freedesktop.Problems2.Session.Authorize`

`Authorize (` | IN Dict<String,Variant> parameters,
| OUT Int32 result`)`;

The method authorizes the client for access to all problems. The method returns immediately and the authorization results are reported through AuthorizationChanged signal.

`parameters`

  Additional parameters that can be used for granting authorization:

  problems2.peer-token

    Secret token of the peer's session.

  problems2.peer-bus

    Unique bus name of the Session that generated the token.

`result`

  -1

    An error occurred

  0

    The authorization request has succeeded and the client is now authorized.

  1

    The authorization request has been accepted.

  2

    The previous authorization request is not finished yet.

### `org.freedesktop.Problems2.Session.RevokeAuthorization`

`RevokeAuthorization (` | `void)`; |

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.

### `org.freedesktop.Problems2.Session.GenerateToken`

`GenerateToken (` | IN UInt32 period,
| OUT String token`)`;

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.

`period`

  This argument defines the validity period of time in seconds. 0 is interpreted as default which may vary between implementations (~5s).

`token`

  A string that should be passed as the value of the 'parent-token' key in the Authorize method's 'parameters' argument.

### `org.freedesktop.Problems2.Session.RevokeToken`

`RevokeToken (` | IN String token`)`;

In case a token is no longer needed. This method can be used to revoke a generated token.

`token`

  Token string returned by GenerateToken method.

## Signals

### `org.freedesktop.Problems2.Session.AuthorizationChanged`

`AuthorizationChanged (` | OUT Int32 status`)`;

Notifies the changes of state of authorization.

`status`

  Describes the change that happened and can be one of the following values:

  0

    The recent authorization request has succeeded and the client is now authorized.

  1

    Authorization request is pending.

  2

    Authorization has been lost.

  3

    Authorization request has failed.

## D-Bus Properties

Accessed using the org.freedesktop.DBus.Properties interface.

`READ Boolean IsAuthorized ;`

TRUE if the client is authorized; otherwise FALSE.

Prev | Up | Next
`org.freedesktop.Problems2.Entry` | Home | `org.freedesktop.Problems2.Task`