Google::Ads::Common::OAuthHandlerInterface


Back to Top


NAME

Google::Ads::Common::OAuthHandlerInterface

Back to Top


DESCRIPTION

Abstract interface to be implemented by concrete OAuth handlers to define the necessary subroutines to fully implement OAuth access to Ad APIs.

Back to Top


METHODS

get_authorization_url

Meant to be implemented by a concrete class, which should issue a request token and return a valid URL for the user to authorize the token. The implementor must save the request token in the token attribute for later use by the upgrade_token method. A callback URL can be passed to re-direct the user after the token is authorized.

Parameters

A required callback URL to which the user will be redirected after authorizing access. A special "oob" out-of-band value is allow to just print the verifier in screen.

Returns

The URL for the user to authorize access to his account. The user first must login in the account that want to grant access to.

upgrade_token

Method to upgrade an authorized request token to an access token for later use by the get_protected_resource_url method. The implementer of this method must re-use the request token generated by the get_authorization_url method and store it for later use.

Parameters

The verifier returned to your callback page or printed out if using 'oob' special callback URL.

get_protected_resource_url

Method to generate a signed URL meant to access a protected resource URL as an Ads API endpoint. The implementer of this method must use the consumer key/secret pair and token/secret pair to properly sign and generate the URL.

Parameters

The protected URL to access.

Returns

A signed URL that can be used to make the request.

is_oauth_enabled

Should return true if the class is prepared to sign and return URLs to access protected resources, which is most of the cases means the class holds a valid consumer key/secret and token/secret pairs.

Returns

True if the class is prepared to sign URL to access protected resources, false otherwise.

Back to Top


LICENSE AND COPYRIGHT

Copyright 2011 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.

Back to Top


AUTHOR

David Torres <api.davidtorres at gmail.com>

Back to Top


REPOSITORY INFORMATION

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

Back to Top

 Google::Ads::Common::OAuthHandlerInterface