authenticate


Description:

public bool authenticate (string username, string password, Cancellable? cancellable = null) throws Error

Authenticates the ClientLoginAuthorizer with the Google Accounts service using username and password and authorizes it against all the service types passed to ClientLoginAuthorizer; i.

e. logs into the service with the given user account. username should be a full e-mail address (e.g. <literal> john.smith@gmail.com</literal>). If a full e-mail address is not given, username will have <literal>@gmail.com </literal> appended to create an e-mail address

If cancellable is not null, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error g_io_error_cancelled will be returned.

If the operation errors or is cancelled part-way through, is_authorized_for_domain is guaranteed to return false for all AuthorizationDomains, even if authentication has succeeded for some of them already.

A gdata_client_login_authorizer_error_bad_authentication will be returned if authentication failed due to an incorrect username or password. Other ClientLoginAuthorizerError errors can be returned for other conditions.

If the service requires a CAPTCHA to be completed, the captcha_challenge signal will be emitted. The return value from a signal handler for the signal should be a newly allocated string containing the text from the image. If the text is null or empty, authentication will fail with a gdata_client_login_authorizer_error_captcha_required error. Otherwise, authentication will be automatically and transparently restarted with the new CAPTCHA details.

A gdata_service_error_protocol_error will be returned if the server's responses were invalid.

Parameters:

this

a ClientLoginAuthorizer

username

the user's username

password

the user's password

cancellable

optional Cancellable object, or null

Returns:

true if authentication and authorization was successful against all the services, false otherwise