| Home · All Classes · All Namespaces · Modules · Functions · Files

Public Slots | Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions
Tp::Client::ChannelInterfaceSASLAuthenticationInterface Class Reference
Channel proxies

`#include <TelepathyQt/Channel>`

Inherits Tp::AbstractInterface.

List of all members.

## Public Slots

- QDBusPendingReply StartMechanism (const QString &mechanism, int timeout=-1)
- QDBusPendingReply StartMechanismWithData (const QString &mechanism, const QByteArray &initialData, int timeout=-1)
- QDBusPendingReply Respond (const QByteArray &responseData, int timeout=-1)
- QDBusPendingReply AcceptSASL (int timeout=-1)
- QDBusPendingReply AbortSASL (uint reason, const QString &debugMessage, int timeout=-1)

## Signals

- void SASLStatusChanged (uint status, const QString &reason, const QVariantMap &details)
- void NewChallenge (const QByteArray &challengeData)

## Public Member Functions

- ChannelInterfaceSASLAuthenticationInterface (const QString &busName, const QString &objectPath, QObject *parent=0)
- ChannelInterfaceSASLAuthenticationInterface (const QDBusConnection &connection, const QString &busName, const QString &objectPath, QObject *parent=0)
- ChannelInterfaceSASLAuthenticationInterface (Tp::DBusProxy *proxy)
- ChannelInterfaceSASLAuthenticationInterface (const Tp::Client::ChannelInterface &mainInterface)
- ChannelInterfaceSASLAuthenticationInterface (const Tp::Client::ChannelInterface &mainInterface, QObject *parent)
- Tp::PendingVariant * requestPropertyAvailableMechanisms () const
- Tp::PendingVariant * requestPropertyHasInitialData () const
- Tp::PendingVariant * requestPropertyCanTryAgain () const
- Tp::PendingVariant * requestPropertySASLStatus () const
- Tp::PendingVariant * requestPropertySASLError () const
- Tp::PendingVariant * requestPropertySASLErrorDetails () const
- Tp::PendingVariant * requestPropertyAuthorizationIdentity () const
- Tp::PendingVariant * requestPropertyDefaultUsername () const
- Tp::PendingVariant * requestPropertyDefaultRealm () const
- Tp::PendingVariant * requestPropertyMaySaveResponse () const
- Tp::PendingVariantMap * requestAllProperties () const

## Static Public Member Functions

- static QLatin1String staticInterfaceName ()

## Protected Member Functions

- virtual void invalidate (Tp::DBusProxy *, const QString &, const QString &)

## Detailed Description

Proxy class providing a 1:1 mapping of the D-Bus interface "org.freedesktop.Telepathy.Channel.Interface.SASLAuthentication".

## Constructor & Destructor Documentation

Tp::Client::ChannelInterfaceSASLAuthenticationInterface::ChannelInterfaceSASLAuthenticationInterface | ( | const QString & | busName,
|  | const QString & | objectPath,
|  | QObject * | parent = `0`
| ) |  |

Creates a ChannelInterfaceSASLAuthenticationInterface associated with the given object on the session bus.

Parameters:

  busName | Name of the service the object is on.
  objectPath | Path to the object on the service.
  parent | Passed to the parent class constructor.

Tp::Client::ChannelInterfaceSASLAuthenticationInterface::ChannelInterfaceSASLAuthenticationInterface | ( | const QDBusConnection & | connection,
|  | const QString & | busName,
|  | const QString & | objectPath,
|  | QObject * | parent = `0`
| ) |  |

Creates a ChannelInterfaceSASLAuthenticationInterface associated with the given object on the given bus.

Parameters:

  connection | The bus via which the object can be reached.
  busName | Name of the service the object is on.
  objectPath | Path to the object on the service.
  parent | Passed to the parent class constructor.

Tp::Client::ChannelInterfaceSASLAuthenticationInterface::ChannelInterfaceSASLAuthenticationInterface | ( | Tp::DBusProxy * | proxy | ) |

Creates a ChannelInterfaceSASLAuthenticationInterface associated with the same object as the given proxy.

Parameters:

  proxy | The proxy to use. It will also be the QObject::parent() for this object.

Tp::Client::ChannelInterfaceSASLAuthenticationInterface::ChannelInterfaceSASLAuthenticationInterface | ( | const Tp::Client::ChannelInterface & | mainInterface | ) | `[explicit]`

Creates a ChannelInterfaceSASLAuthenticationInterface associated with the same object as the given proxy. Additionally, the created proxy will have the same parent as the given proxy.

Parameters:

  mainInterface | The proxy to use.

Tp::Client::ChannelInterfaceSASLAuthenticationInterface::ChannelInterfaceSASLAuthenticationInterface | ( | const Tp::Client::ChannelInterface & | mainInterface,
|  | QObject * | parent
| ) |  |

Creates a ChannelInterfaceSASLAuthenticationInterface associated with the same object as the given proxy. However, a different parent object can be specified.

Parameters:

  mainInterface | The proxy to use.
  parent | Passed to the parent class constructor.

## Member Function Documentation

static QLatin1String Tp::Client::ChannelInterfaceSASLAuthenticationInterface::staticInterfaceName | ( |  | ) | `[inline, static]`

Returns the name of the interface "org.freedesktop.Telepathy.Channel.Interface.SASLAuthentication", which this class represents.

Returns:
  The D-Bus interface name.

Tp::PendingVariant* Tp::Client::ChannelInterfaceSASLAuthenticationInterface::requestPropertyAvailableMechanisms | ( |  | ) | const`[inline]`

Asynchronous getter for the remote object property `AvailableMechanisms` of type `QStringList`.

The SASL mechanisms as offered by the server, plus any pseudo-SASL mechanisms supported by the connection manager for credentials transfer. For instance, in a protocol that natively uses SASL (like XMPP), this might be `[ "X-TELEPATHY-PASSWORD", "PLAIN", "DIGEST-MD5", "SCRAM-SHA-1" ]`.

To make it possible to implement a very simple password-querying user interface without knowledge of any particular SASL mechanism, implementations of this interface MUST implement the pseudo-mechanism `X-TELEPATHY-PASSWORD`, unless none of the available mechanisms use a password at all.

Returns:
  A pending variant which will emit finished when the property has been retrieved.

Tp::PendingVariant* Tp::Client::ChannelInterfaceSASLAuthenticationInterface::requestPropertyHasInitialData | ( |  | ) | const`[inline]`

Asynchronous getter for the remote object property `HasInitialData` of type `bool`.

If true, StartMechanismWithData() can be expected to work for SASL mechanisms not starting with `X-TELEPATHY-` (this is the case in most, but not all, protocols). If false, StartMechanism() must be used instead.

This property does not affect the `X-TELEPATHY-` pseudo-mechanisms such as `X-TELEPATHY-PASSWORD`, which can use StartMechanismWithData() regardless of the value of this property.

Returns:
  A pending variant which will emit finished when the property has been retrieved.

Tp::PendingVariant* Tp::Client::ChannelInterfaceSASLAuthenticationInterface::requestPropertyCanTryAgain | ( |  | ) | const`[inline]`

Asynchronous getter for the remote object property `CanTryAgain` of type `bool`.

If true, StartMechanism() and (if supported) StartMechanismWithData() can be expected to work when in one of the Failed states. If false, the only thing you can do after failure is to close the channel.

Retrying isn't required to work, although some protocols and implementations allow it.

Returns:
  A pending variant which will emit finished when the property has been retrieved.

Tp::PendingVariant* Tp::Client::ChannelInterfaceSASLAuthenticationInterface::requestPropertySASLStatus | ( |  | ) | const`[inline]`

Asynchronous getter for the remote object property `SASLStatus` of type `uint`.

The current status of this channel. Change notification is via the SASLStatusChanged() signal.

Returns:
  A pending variant which will emit finished when the property has been retrieved.

Tp::PendingVariant* Tp::Client::ChannelInterfaceSASLAuthenticationInterface::requestPropertySASLError | ( |  | ) | const`[inline]`

Asynchronous getter for the remote object property `SASLError` of type `QString`.

The reason for the SASLStatus , or an empty string if the state is neither Server_Failed nor Client_Failed.

In particular, an ordinary authentication failure (as would be produced for an incorrect password) SHOULD be represented by AuthenticationFailed, cancellation by the user's request SHOULD be represented by Cancelled, and cancellation by a local process due to inconsistent or invalid challenges from the server SHOULD be represented by ServiceConfused.

If this interface appears on a ChannelTypeServerAuthenticationInterface channel, and connection to the server fails with an authentication failure, this error code SHOULD be copied into the ConnectionInterface::ConnectionError() signal.

Returns:
  A pending variant which will emit finished when the property has been retrieved.

Tp::PendingVariant* Tp::Client::ChannelInterfaceSASLAuthenticationInterface::requestPropertySASLErrorDetails | ( |  | ) | const`[inline]`

Asynchronous getter for the remote object property `SASLErrorDetails` of type `QVariantMap`.

If SASLError is non-empty, any additional information about the last disconnection; otherwise, the empty map. The keys and values are the same as for the second argument of ConnectionInterface::ConnectionError() .

If this interface appears on a ChannelTypeServerAuthenticationInterface channel, and connection to the server fails with an authentication failure, these details SHOULD be copied into the ConnectionInterface::ConnectionError() signal.

Returns:
  A pending variant which will emit finished when the property has been retrieved.

Tp::PendingVariant* Tp::Client::ChannelInterfaceSASLAuthenticationInterface::requestPropertyAuthorizationIdentity | ( |  | ) | const`[inline]`

Asynchronous getter for the remote object property `AuthorizationIdentity` of type `QString`.

The identity for which authorization is being attempted, typically the 'account' from the ConnectionManagerInterface::RequestConnection() parameters, normalized and formatted according to the conventions used for SASL in this protocol.

The normalization used for SASL might not be the same normalization used elsewhere: for instance, in a protocol with email-like identifiers such as XMPP or SIP, the user "juliet@example.com" might have to authenticate to the example.com server via SASL PLAIN as "juliet".

This is usually achieved by using the authorization identity for authentication, but an advanced Handler could offer the option to authenticate under a different identity.

The terminology used here is that the authorization identity is who you want to act as, and the authentication identity is used to prove that you may do so. For instance, if Juliet is authorized to access a role account, "sysadmin@example.com", and act on its behalf, it might be possible to authenticate as "juliet@example.com" with her own password, but request to be authorized as "sysadmin@example.com" instead of her own account. See RFC 4422 §3.4.1 for more details.

In SASL the authorization identity is normally guessed from the authentication identity, but the information available to the connection manager is the identity for which authorization is required, such as the desired JID in XMPP, so that's what we signal to UIs; it's up to the UI to choose whether to authenticate as the authorization identity or some other identity.

As a concrete example, the "sysadmin" XMPP account mentioned above would have `{ 'account': 'sysadmin@example.com' }` in its Parameters, and this property would also be 'sysadmin@example.com'. A simple Handler would merely prompt for sysadmin@example.com's password, and use that JID as both the authorization and authentication identity, which might result in SASL PLAIN authentication with the initial response '\\000sysadmin@example.com\\000root'.

A more advanced Handler might also ask for an authentication identity, defaulting to 'sysadmin@example.com'; if Juliet provided authentication identity 'juliet@example.com' and password 'romeo', the Handler might perform SASL PLAIN authentication using the initial response 'sysadmin@example.com\\000juliet@example.com\\000romeo'.

Returns:
  A pending variant which will emit finished when the property has been retrieved.

Tp::PendingVariant* Tp::Client::ChannelInterfaceSASLAuthenticationInterface::requestPropertyDefaultUsername | ( |  | ) | const`[inline]`

Asynchronous getter for the remote object property `DefaultUsername` of type `QString`.

The default username for use with SASL mechanisms that deal with a "simple username" (as defined in RFC 4422). If such a SASL mechanism is in use, clients SHOULD default to using the DefaultUsername; also, if the client uses the DefaultUsername, it SHOULD assume that the authorization identity AuthorizationIdentity will be derived from it by the server.

In XMPP, servers typically expect "user@example.com" to authenticate with username "user"; this was a SHOULD in RFC 3920.

3920bis weakens that SHOULD to "in the absence of local information provided by the server, an XMPP client SHOULD assume that the authentication identity for such a SASL mechanism is the combination of a user name and password, where the simple user name is the localpart of the user's JID".

For example, in the simple case, if the user connects with ConnectionManagerInterface::RequestConnection() ({ account: "`user@example.com`" }) and use PLAIN with password "password", he or she should authenticate like so: "`\\0user\\0password`" and the channel will look like this:

>     { "...  DefaultUsername   ": "user",
>        "...  AuthorizationIdentity   ": "user@example.com }

In the complex case, if the same user is using his or her sysadmin powers to log in as the "announcements" role address, he or she would connect with ConnectionManagerInterface::RequestConnection() ({ account: "`announcements@example.com`" }) and the SASL channel would look like this:

>     { "...  DefaultUsername   ": "announcements",
>        "...  AuthorizationIdentity   ": "announcements@example.com }

A sufficiently elaborate UI could give the opportunity to override the username from "announcements" to "user". The user's simple username is still "user", and the password is still "password", but this time he or she is trying to authorize to act as `announcements@example.com`, so the UI would have to perform SASL PLAIN with this string: "`announcements@example.com\\0user\\0password`", where "announcements@example.com" is the AuthorizationIdentity .

Returns:
  A pending variant which will emit finished when the property has been retrieved.

Tp::PendingVariant* Tp::Client::ChannelInterfaceSASLAuthenticationInterface::requestPropertyDefaultRealm | ( |  | ) | const`[inline]`

Asynchronous getter for the remote object property `DefaultRealm` of type `QString`.

The default realm (as defined in RFC 2831) to use for authentication, if the server does not supply one.

The server is not required to provide a realm; if it doesn't, the client is expected to ask the user or provide a sensible default, typically the requested DNS name of the server. In some implementations of `DIGEST-MD5`, the server does not specify a realm, but expects that the client will choose a particular default, and authentication will fail if the client's default is different. Connection managers for protocols where this occurs are more easily able to work around these implementations than a generic client would be.

Returns:
  A pending variant which will emit finished when the property has been retrieved.

Tp::PendingVariant* Tp::Client::ChannelInterfaceSASLAuthenticationInterface::requestPropertyMaySaveResponse | ( |  | ) | const`[inline]`

Asynchronous getter for the remote object property `MaySaveResponse` of type `bool`.

Whether or not the client can save the authentication response and re-use it to automate future authentication challenges.

If this property is `False`, the client SHOULD NOT attempt to cache the authentication response in its own keyring.

If this property is not specified, it should be treated as if it were `True`.

Some protocols or services may have terms and conditions that prohibit caching a user's credentials.

Returns:
  A pending variant which will emit finished when the property has been retrieved.

Tp::PendingVariantMap* Tp::Client::ChannelInterfaceSASLAuthenticationInterface::requestAllProperties | ( |  | ) | const`[inline]`

Request all of the DBus properties on the interface.

Returns:
  A pending variant map which will emit finished when the properties have been retrieved.

QDBusPendingReply Tp::Client::ChannelInterfaceSASLAuthenticationInterface::StartMechanism | ( | const QString & | mechanism,
|  | int | timeout = `-1`
| ) |  | `[inline, slot]`

Begins a call to the D-Bus method `StartMechanism` on the remote object.

Start an authentication try using Mechanism, without sending initial data (an "initial response" as defined in RFC 4422).

This method is appropriate for mechanisms where the client cannot send anything until it receives a challenge from the server, such as `DIGEST-MD5` in "initial authentication" mode.

Note that timeout is ignored as of now. It will be used once http://bugreports.qt.nokia.com/browse/QTBUG-11775 is fixed.

Parameters:

  mechanism | The chosen mechanism.
  timeout | The timeout in milliseconds.

QDBusPendingReply Tp::Client::ChannelInterfaceSASLAuthenticationInterface::StartMechanismWithData | ( | const QString & | mechanism,
|  | const QByteArray & | initialData,
|  | int | timeout = `-1`
| ) |  | `[inline, slot]`

Begins a call to the D-Bus method `StartMechanismWithData` on the remote object.

Start an authentication try using Mechanism, and send Initial_Data as the "initial response" defined in RFC 4422 §3.3.

This method is appropriate for mechanisms where the client may send data first, such as `PLAIN`, or must send data first, such as `DIGEST-MD5` in "subsequent authentication" mode.

Having two methods allows any mechanism where it makes a difference to distinguish between the absence of an initial response ( StartMechanism() ) and a zero-byte initial response (StartMechanismWithData, with Initial_Data empty).

If the HasInitialData property is false, this indicates that the underlying protocol does not make it possible to send initial data. In such protocols, this method may only be used for the `X-TELEPATHY-` pseudo-mechanisms (such as `X-TELEPATHY-PASSWORD`), and will fail if used with an ordinary SASL mechanism.

For instance, the IRC SASL extension implemented in Charybdis and Atheme does not support initial data - the first message in the exchange only carries the mechanism. This is significant if using `DIGEST-MD5`, which cannot be used in the faster "subsequent authentication" mode on a protocol not supporting initial data.

Note that timeout is ignored as of now. It will be used once http://bugreports.qt.nokia.com/browse/QTBUG-11775 is fixed.

Parameters:

  mechanism | The chosen mechanism.
  initialData | Initial data (an "initial response" in RFC 4422's terminology) to send with the mechanism.
  timeout | The timeout in milliseconds.

QDBusPendingReply Tp::Client::ChannelInterfaceSASLAuthenticationInterface::Respond | ( | const QByteArray & | responseData,
|  | int | timeout = `-1`
| ) |  | `[inline, slot]`

Begins a call to the D-Bus method `Respond` on the remote object.

Send a response to the the last challenge received via NewChallenge() .

Note that timeout is ignored as of now. It will be used once http://bugreports.qt.nokia.com/browse/QTBUG-11775 is fixed.

Parameters:

  responseData | The response data.
  timeout | The timeout in milliseconds.

QDBusPendingReply Tp::Client::ChannelInterfaceSASLAuthenticationInterface::AcceptSASL | ( | int | timeout = `-1` | ) | `[inline, slot]`

Begins a call to the D-Bus method `AcceptSASL` on the remote object.

If the channel's status is SASL_Status_Server_Succeeded, this method confirms successful authentication and advances the status of the channel to SASL_Status_Succeeded.

If the channel's status is SASL_Status_In_Progress, calling this method indicates that the last NewChallenge() signal was in fact additional data sent after a successful SASL negotiation, and declares that from the client's point of view, authentication was successful. This advances the state of the channel to SASL_Status_Client_Accepted.

In mechanisms where the server authenticates itself to the client, calling this method indicates that the client considers this to have been successful. In the case of ChannelTypeServerAuthenticationInterface channels, this means that the connection manager MAY continue to connect, and MAY advance the ConnectionInterface::Status to Connected.

Note that timeout is ignored as of now. It will be used once http://bugreports.qt.nokia.com/browse/QTBUG-11775 is fixed.

Parameters:

  timeout | The timeout in milliseconds.

QDBusPendingReply Tp::Client::ChannelInterfaceSASLAuthenticationInterface::AbortSASL | ( | uint | reason,
|  | const QString & | debugMessage,
|  | int | timeout = `-1`
| ) |  | `[inline, slot]`

Begins a call to the D-Bus method `AbortSASL` on the remote object.

Abort the current authentication try.

If the current status is SASL_Status_Server_Failed or SASL_Status_Client_Failed, this method returns successfully, but has no further effect. If the current status is SASL_Status_Succeeded or SASL_Status_Client_Accepted then NotAvailable is raised. Otherwise, it changes the channel's state to SASL_Status_Client_Failed, with an appropriate error name and reason code.

Note that timeout is ignored as of now. It will be used once http://bugreports.qt.nokia.com/browse/QTBUG-11775 is fixed.

Parameters:

  reason | Reason for abort.
  debugMessage | Debug message for abort.
  timeout | The timeout in milliseconds.

void Tp::Client::ChannelInterfaceSASLAuthenticationInterface::SASLStatusChanged | ( | uint | status,
|  | const QString & | reason,
|  | const QVariantMap & | details
| ) |  | `[signal]`

Represents the signal `SASLStatusChanged` on the remote object.

Emitted when the status of the channel changes.

Parameters:

  status | The new value of SASLStatus.
  reason | The new value of SASLError.
  details | The new value of SASLErrorDetails.

void Tp::Client::ChannelInterfaceSASLAuthenticationInterface::NewChallenge | ( | const QByteArray & | challengeData | ) | `[signal]`

Represents the signal `NewChallenge` on the remote object.

Emitted when a new challenge is received from the server, or when a message indicating successful authentication and containing additional data is received from the server.

When the channel's handler is ready to proceed, it should respond to the challenge by calling Respond() , or respond to the additional data by calling AcceptSASL() . Alternatively, it may call AbortSASL() to abort authentication.

Parameters:

  challengeData | The challenge data or additional data from the server.

void Tp::Client::ChannelInterfaceSASLAuthenticationInterface::invalidate | ( | Tp::DBusProxy * | proxy,
|  | const QString & | error,
|  | const QString & | message
| ) |  | `[protected, virtual]`

Reimplemented from Tp::AbstractInterface.