NAME

Google::Ads::Common::AuthTokenHandler

DESCRIPTION

Google::Ads::Common::AuthTokenHandler implements most of the methods required to request AuthTokens using the ClientLogin protocol, see https://developers.google.com/accounts/docs/AuthForInstalledApps for more information about the protocol.

ATTRIBUTES

Each of these attributes can be set via the constructor as a hash. Alternatively, there is a get_ and set_ method associated with each attribute for retrieving or setting them dynamically.

email

The email of the account to authorization against.

password

The password to use for authorization.

auth_server

Endpoint of the authorization server.

auth_token

Auth token either manually set or generated.

issued_in

time in which the token was issued if it was requested by this class.

METHODS

initialize

Initializes the handler with properties such as the email and password to use for generating AuthTokens.

Parameters

  • A required api_client with a reference to the API client object handling the requests against the API.

  • A hash reference with the following keys: { # The service name to access. service => "adwords", # The email address of a Google Account. email => "user@domain.com", # The password for the Google Account. password => "password", }

is_auth_enabled

Returns

True, if a valid AuthToken is available or can be generated to use within API requests.

refresh_auth_token

Forces refreshing the auth token using the credentials set in the handler.

issue_new_token

Calls the authorization server to generate a new AuthToken. Sets the generated AuthToken in the auth_token property as well as the issued_in property. A captcha token and code can be passed to this method to handle captcha challenges

Parameters

Returns

Returns an error of type Google::Ads::Common::CaptchaRequiredError or Google::Ads::Common::AuthError if an error occurred while generating the token.

LICENSE AND COPYRIGHT

Copyright 2012 Google Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

AUTHOR

David Torres <david.t at google.com>

REPOSITORY INFORMATION

$Rev: $
$LastChangedBy: $
$Id: $

1 POD Error

The following errors were encountered while parsing the POD:

Around line 315:

You forgot a '=back' before '=head2'