Google::Ads::GoogleAds::Common::OAuth2ApplicationsHandler
A generic abstract implementation of Google::Ads::GoogleAds::Common::OAuth2BaseHandler that supports OAuth2 for Web/Installed Applications semantics.
It is meant to be specialized and its "_scope" and "_formatted_scopes" methods should be properly implemented.
Each of these attributes can be set via Google::Ads::GoogleAds::Common::OAuth2ApplicationsHandler->new().
Alternatively, there is a get_ and set_ method associated with each attribute for retrieving or setting them dynamically.
A reference to the API client used to handle the API requests.
OAuth2 client id obtained from the Google APIs Console.
OAuth2 client secret obtained from the Google APIs Console.
OAuth2 access type to be requested when following the authorization flow. It defaults to offline but it can be set to online.
OAuth2 prompt to be used when following the authorization flow. It defaults to consent.
Redirect URI as set for you in the Google APIs console, to which the authorization flow will callback with the authorization code. Defaults to urn:ietf:wg:oauth:2.0:oob for the installed applications flow.
Stores an OAuth2 access token after the authorization flow is followed or for you to manually set it in case you had it previously stored. If this is manually set this handler will verify its validity before preparing a request.
Stores an OAuth2 refresh token in case of an offline "access_type" is requested. It is automatically used by the handler to request new access tokens i.e. when they are expired or found invalid.
Stores additional OAuth2 scopes as a comma-separated string. The scope defines which services the tokens are allowed to access e.g. https://www.googleapis.com/auth/analytics
Initializes the handler with the API client object and the properties such as client_id and client_secret, used for generating authorization requests.
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:
{ clientId => "client-id", clientSecret => "client-secret", accessTyoe => "access-type", approvalPrompt => "approval-prompt", redirectUri => "redirect-uri", accessToken => "access-token", refreshToken => "refresh-token", additionalScopes => "additional-scopes", }
Refer to the documentation of the properties as "client_id", "client_secret", "access_type", "prompt", "redirect_uri", "access_token", "refresh_token" and </additional_scopes>.
Refer to Google::Ads::GoogleAds::Common::AuthHandlerInterface documentation of this method.
Refer to Google::Ads::GoogleAds::Common::OAuthApplicationsHandlerInterface documentation of this method.
Refer to Google::Ads::GoogleAds::Common::OAuth2BaseHandler documentation of this method.
Method defined by Google::Ads::GoogleAds::Common::OAuth2BaseHandler and implemented in this class to refresh the stored OAuth2 access token.
Method to be implemented by a concrete class, which should return the OAuth2 scopes as a list of encoded URLs separated by pluses. This is the format expected when sending the OAuth2 request in a URL.
Copyright 2019 Google LLC
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.
$Rev: $ $LastChangedBy: $ $Id: $
To install Google::Ads::GoogleAds::Client, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Google::Ads::GoogleAds::Client
CPAN shell
perl -MCPAN -e shell install Google::Ads::GoogleAds::Client
For more information on module installation, please visit the detailed CPAN module installation guide.