Camel.Sasl

g Camel.Sasl Camel.Sasl GObject.Object GObject.Object GObject.Object->Camel.Sasl

Subclasses:

Camel.SaslAnonymous, Camel.SaslCramMd5, Camel.SaslDigestMd5, Camel.SaslGssapi, Camel.SaslLogin, Camel.SaslNTLM, Camel.SaslPOPB4SMTP, Camel.SaslPlain, Camel.SaslXOAuth2

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

authtype (mechanism)

class

authtype_list (include_plain)

class

is_xoauth2_alias (mechanism)

class

new (service_name, mechanism, service)

challenge (token, io_priority, cancellable, callback, *user_data)

challenge_base64 (token, io_priority, cancellable, callback, *user_data)

challenge_base64_finish (result)

challenge_base64_sync (token, cancellable)

challenge_finish (result)

challenge_sync (token, cancellable)

get_authenticated ()

get_mechanism ()

get_service ()

get_service_name ()

set_authenticated (authenticated)

try_empty_password (io_priority, cancellable, callback, *user_data)

try_empty_password_finish (result)

try_empty_password_sync (cancellable)

Virtual Methods

Inherited:

GObject.Object (7)

do_challenge_sync (token, cancellable)

do_try_empty_password_sync (cancellable)

Properties

Name

Type

Flags

Short Description

authenticated

bool

r/w/en

mechanism

str

r/w/co

service

Camel.Service

r/w/co

service-name

str

r/w/co

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

GObject.Object

r

Class Details

class Camel.Sasl(**kwargs)
Bases:

GObject.Object

Abstract:

Yes

Structure:

Camel.SaslClass

classmethod authtype(mechanism)
Parameters:

mechanism (str) – the SASL mechanism to get an authtype for

Returns:

a Camel.ServiceAuthType for the given mechanism, if it is supported.

Return type:

Camel.ServiceAuthType or None

classmethod authtype_list(include_plain)
Parameters:

include_plain (bool) – whether or not to include the PLAIN mechanism

Returns:

a GLib.List of SASL-supported authtypes. The caller must free the list, but not the contents.

Return type:

[Camel.ServiceAuthType]

classmethod is_xoauth2_alias(mechanism)
Parameters:

mechanism (str or None) – an authentication mechanism

Returns:

whether exists Camel.Sasl for the given mechanism, which also derives from Camel.SaslXOAuth2.

Return type:

bool

Checks whether exists a Camel.Sasl method for the mechanism and whether it derives from Camel.SaslXOAuth2. Such mechanisms are also treated as XOAUTH2, even their real name is different.

New in version 3.28.

classmethod new(service_name, mechanism, service)
Parameters:
  • service_name (str) – the SASL service name

  • mechanism (str) – the SASL mechanism

  • service (Camel.Service) – the Camel.Service that will be using this SASL

Returns:

a new Camel.Sasl object for the given service_name, mechanism, and service, or None if the mechanism is not supported.

Return type:

Camel.Sasl or None

challenge(token, io_priority, cancellable, callback, *user_data)
Parameters:

If token is None, asynchronously generate the initial SASL message to send to the server. (This will be None if the client doesn’t initiate the exchange.) Otherwise, token is a challenge from the server, and the asynchronous result is the response.

When the operation is finished, callback will be called. You can then call Camel.Sasl.challenge_finish() to get the result of the operation.

New in version 3.0.

challenge_base64(token, io_priority, cancellable, callback, *user_data)
Parameters:

As with Camel.Sasl.challenge(), but the challenge token and the response are both base64-encoded.

When the operation is finished, callback will be called. You can then call Camel.Sasl.challenge_base64_finish() to get the result of the operation.

New in version 3.0.

challenge_base64_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult

Raises:

GLib.Error

Returns:

the base64-encoded response

Return type:

str

Finishes the operation started with Camel.Sasl.challenge_base64().

New in version 3.0.

challenge_base64_sync(token, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

the base64-encoded response

Return type:

str

As with Camel.Sasl.challenge_sync(), but the challenge token and the response are both base64-encoded.

New in version 3.0.

challenge_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult

Raises:

GLib.Error

Returns:

the SASL response or None. If an error occurred, error will also be set.

Return type:

bytes or None

Finishes the operation started with Camel.Sasl.challenge(). Free the returned GLib.ByteArray with GLib.ByteArray.free().

New in version 3.0.

challenge_sync(token, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

the SASL response or None. If an error occurred, error will also be set.

Return type:

bytes or None

If token is None, generate the initial SASL message to send to the server. (This will be None if the client doesn’t initiate the exchange.) Otherwise, token is a challenge from the server, and the return value is the response.

Free the returned GLib.ByteArray with GLib.ByteArray.free().

get_authenticated()
Returns:

whether or not self has successfully authenticated the user. This will be True after it returns the last needed response. The caller must still pass that information on to the server and verify that it has accepted it.

Return type:

bool

get_mechanism()
Return type:

str

New in version 2.32.

get_service()
Return type:

Camel.Service

New in version 2.32.

get_service_name()
Return type:

str

New in version 2.32.

set_authenticated(authenticated)
Parameters:

authenticated (bool) – whether we have successfully authenticated

New in version 2.32.

try_empty_password(io_priority, cancellable, callback, *user_data)
Parameters:

Asynchronously determine whether self can be used for password-less authentication, for example single-sign-on using system credentials.

When the operation is finished, callback will be called. You can then call Camel.Sasl.try_empty_password_finish() to get the result of the operation.

New in version 3.2.

try_empty_password_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult

Raises:

GLib.Error

Returns:

the SASL response. If an error occurred, error will also be set.

Return type:

bool

Finishes the operation started with Camel.Sasl.try_empty_password().

New in version 3.2.

try_empty_password_sync(cancellable)
Parameters:

cancellable (Gio.Cancellable or None) – optional Gio.Cancellable object, or None

Raises:

GLib.Error

Returns:

whether or not self can attempt to authenticate without a password being provided by the caller. This will be True for an authentication method which can attempt to use single-sign-on credentials, but which can fall back to using a provided password so it still has the need_password flag set in its description.

Return type:

bool

New in version 3.2.

do_challenge_sync(token, cancellable) virtual
Parameters:
Returns:

the SASL response or None. If an error occurred, error will also be set.

Return type:

bytes or None

If token is None, generate the initial SASL message to send to the server. (This will be None if the client doesn’t initiate the exchange.) Otherwise, token is a challenge from the server, and the return value is the response.

Free the returned GLib.ByteArray with GLib.ByteArray.free().

do_try_empty_password_sync(cancellable) virtual
Parameters:

cancellable (Gio.Cancellable or None) – optional Gio.Cancellable object, or None

Returns:

whether or not sasl can attempt to authenticate without a password being provided by the caller. This will be True for an authentication method which can attempt to use single-sign-on credentials, but which can fall back to using a provided password so it still has the need_password flag set in its description.

Return type:

bool

New in version 3.2.

Property Details

Camel.Sasl.props.authenticated
Name:

authenticated

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Camel.Sasl.props.mechanism
Name:

mechanism

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Camel.Sasl.props.service
Name:

service

Type:

Camel.Service

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Camel.Sasl.props.service_name
Name:

service-name

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY