credentials_required_sync


Description:

[ Version ( since = "3.16" ) ]
public bool credentials_required_sync (SourceCredentialsReason reason, string certificate_pem, TlsCertificateFlags certificate_errors, Error? op_error, Cancellable? cancellable = null) throws Error

Synchronously lets the clients know that the backned requires credentials to be properly opened.

It's a proxy function for invoke_credentials_required_sync, where can be found more information about actual parameters meaning.

The provided credentials are received through authenticate_sync method asynchronously.

Note for sources authenticating with OAuth2: their credentials cannot be looked up silently, thus this call always ends in an interactive prompt (an OAuth2 consent window in the client). A backend whose source uses OAuth2 should call schedule_authenticate with null credentials instead and obtain the access token in its authenticate_sync implementation, for example with get_oauth2_access_token_sync, invoking the credentials-required only when that fails.

If an error occurs, the function sets throws and returns false.

Parameters:

this

an Backend

reason

an SourceCredentialsReason, why the credentials are required

certificate_pem

PEM-encoded secure connection certificate, or an empty string

certificate_errors

a bit-or of TlsCertificateFlags for secure connection certificate

op_error

a Error with a description of the previous credentials error, or null

cancellable

optional Cancellable object, or null

Returns:

true on success, false on error