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) | 
|---|
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.ServiceAuthTypefor the given mechanism, if it is supported.- Return type: - Camel.ServiceAuthType
 - 
classmethod authtype_list(include_plain)¶
- Parameters: - include_plain ( - bool) – whether or not to include the PLAIN mechanism- Returns: - a - GLib.Listof SASL-supported authtypes. The caller must free the list, but not the contents.- Return type: - [ - Camel.ServiceAuthType]
 - 
classmethod is_xoauth2_alias(mechanism)¶
- Parameters: - mechanism ( - stror- None) – an authentication mechanism- Returns: - whether exists - Camel.Saslfor the given mechanism, which also derives from- Camel.SaslXOAuth2.- Return type: - bool- Checks whether exists a - Camel.Saslmethod 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) – theCamel.Servicethat will be using this SASL
 - Returns: - a new - Camel.Saslobject for the given service_name, mechanism, and service, or- Noneif the mechanism is not supported.- Return type: - Camel.Saslor- None
- service_name (
 - 
challenge(token, io_priority, cancellable, callback, *user_data)¶
- Parameters: - token (bytes) – a token, orNone
- io_priority (int) – the I/O priority of the request
- cancellable (Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
- callback (Gio.AsyncReadyCallbackorNone) – aGio.AsyncReadyCallbackto call when the request is satisfied
- user_data (objectorNone) – data to pass to the callback function
 - If token is - None, asynchronously generate the initial SASL message to send to the server. (This will be- Noneif 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. 
- token (
 - 
challenge_base64(token, io_priority, cancellable, callback, *user_data)¶
- Parameters: - token (str) – a base64-encoded token
- io_priority (int) – the I/O priority of the request
- cancellable (Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
- callback (Gio.AsyncReadyCallbackorNone) – aGio.AsyncReadyCallbackto call when the request is satisfied
- user_data (objectorNone) – data to pass to the callback function
 - 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. 
- token (
 - 
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: - token (str) – a base64-encoded token
- cancellable (Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
 - Raises: - Returns: - the base64-encoded response - Return type: - As with - Camel.Sasl.challenge_sync(), but the challenge token and the response are both base64-encoded.- New in version 3.0. 
- token (
 - 
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- Finishes the operation started with - Camel.Sasl.challenge(). Free the returned- GLib.ByteArraywith- GLib.ByteArray.free().- New in version 3.0. 
 - 
challenge_sync(token, cancellable)¶
- Parameters: - token (bytes) – a token, orNone
- cancellable (Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
 - Raises: - Returns: - the SASL response or - None. If an error occurred, error will also be set.- Return type: - If token is - None, generate the initial SASL message to send to the server. (This will be- Noneif 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.ByteArraywith- GLib.ByteArray.free().
- token (
 - 
get_authenticated()¶
- Returns: - whether or not self has successfully authenticated the user. This will be - Trueafter 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_service()¶
- Return type: - Camel.Service- 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: - io_priority (int) – the I/O priority of the request
- cancellable (Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
- callback (Gio.AsyncReadyCallbackorNone) – aGio.AsyncReadyCallbackto call when the request is satisfied
- user_data (objectorNone) – data to pass to the callback function
 - 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. 
- io_priority (
 - 
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.Cancellableor- None) – optional- Gio.Cancellableobject, 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 - Truefor 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: - token (bytes) – a token, orNone
- cancellable (Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
 - Returns: - the SASL response or - None. If an error occurred, error will also be set.- Return type: - If token is - None, generate the initial SASL message to send to the server. (This will be- Noneif 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.ByteArraywith- GLib.ByteArray.free().
- token (
 - 
do_try_empty_password_sync(cancellable) virtual¶
- Parameters: - cancellable ( - Gio.Cancellableor- None) – optional- Gio.Cancellableobject, or- None- Returns: - whether or not sasl can attempt to authenticate without a password being provided by the caller. This will be - Truefor 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. 
 
- 
classmethod 
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