request_authorization


Description:

public bool request_authorization (string token, string token_secret, string verifier, Cancellable? cancellable = null) throws Error

Requests authorization of the given request token from the Google accounts service using the given verifier as entered by the user from the authentication page at the URI returned by request_authentication_uri.

token and token_secret must be the same values as were returned by request_authentication_uri if it was successful.

If the verifier is valid (i.e. the user granted access to the application and the Google accounts service has no reason to distrust the client), true will be returned and any operations performed from that point onwards on Services using this Authorizer will be authorized.

If the user denies access to the application or the Google accounts service distrusts it, a bogus verifier could be returned. In this case, false will be returned and a gdata_service_error_forbidden error will be raised.

Note that if the user denies access to the application, it may be the case that they have no verifier to enter. In this case, the client can simply not call this method. The OAuth1Authorizer stores no state for authentication operations which have succeeded in calling request_authentication_uri but not yet successfully called request_authorization.

This method implements <ulink type="http" url="http://tools.ietf.org/html/rfc5849section-2.3">Section 2.3</ulink > of the <ulink type="http" url="http://tools.ietf.org/html/rfc5849">OAuth 1.0 protocol</ulink>.

Parameters:

this

a OAuth1Authorizer

token

the request token returned by request_authentication_uri

token_secret

the request token secret returned by request_authentication_uri

verifier

the verifier entered by the user from the authentication page

cancellable

optional Cancellable object, or null

Returns:

true if authorization was successful, false otherwise