* Copyright 2010 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
* 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
* Service definition for Oauth2 (v2).
* Lets you access OAuth2 protocol related APIs.</p>
* For more information about this service, see the API
* <a href="https://developers.google.com/accounts/docs/OAuth2" target="_blank">Documentation</a>
class UDP_Google_Service_Oauth2 extends UDP_Google_Service
/** Know your basic profile info and list of people in your circles.. */
"https://www.googleapis.com/auth/plus.login";
/** Know who you are on Google. */
"https://www.googleapis.com/auth/plus.me";
/** View your email address. */
"https://www.googleapis.com/auth/userinfo.email";
/** View your basic profile info. */
"https://www.googleapis.com/auth/userinfo.profile";
* Constructs the internal representation of the Oauth2 service.
* @param UDP_Google_Client $client
public function __construct(UDP_Google_Client $client)
parent::__construct($client);
$this->serviceName = 'oauth2';
$this->userinfo = new Google_Service_Oauth2_Userinfo_Resource(
'path' => 'oauth2/v2/userinfo',
$this->userinfo_v2_me = new Google_Service_Oauth2_UserinfoV2Me_Resource(
'path' => 'userinfo/v2/me',
$this->base_methods = new UDP_Google_Service_Resource(
'getCertForOpenIdConnect' => array(
'path' => 'oauth2/v2/certs',
'path' => 'oauth2/v2/tokeninfo',
* (getCertForOpenIdConnect)
* @param array $optParams Optional parameters.
* @return Google_Service_Oauth2_Jwk
public function getCertForOpenIdConnect($optParams = array())
$params = array_merge($params, $optParams);
return $this->base_methods->call('getCertForOpenIdConnect', array($params), "Google_Service_Oauth2_Jwk");
* @param array $optParams Optional parameters.
* @opt_param string access_token
* @opt_param string id_token
* @opt_param string token_handle
* @return Google_Service_Oauth2_Tokeninfo
public function tokeninfo($optParams = array())
$params = array_merge($params, $optParams);
return $this->base_methods->call('tokeninfo', array($params), "Google_Service_Oauth2_Tokeninfo");
* The "userinfo" collection of methods.
* $oauth2Service = new UDP_Google_Service_Oauth2(...);
* $userinfo = $oauth2Service->userinfo;
class Google_Service_Oauth2_Userinfo_Resource extends UDP_Google_Service_Resource
* @param array $optParams Optional parameters.
* @return Google_Service_Oauth2_Userinfoplus
public function get($optParams = array())
$params = array_merge($params, $optParams);
return $this->call('get', array($params), "Google_Service_Oauth2_Userinfoplus");
* The "v2" collection of methods.
* $oauth2Service = new UDP_Google_Service_Oauth2(...);
* $v2 = $oauth2Service->v2;
class Google_Service_Oauth2_UserinfoV2_Resource extends UDP_Google_Service_Resource
* The "me" collection of methods.
* $oauth2Service = new UDP_Google_Service_Oauth2(...);
* $me = $oauth2Service->me;
class Google_Service_Oauth2_UserinfoV2Me_Resource extends UDP_Google_Service_Resource
* @param array $optParams Optional parameters.
* @return Google_Service_Oauth2_Userinfoplus
public function get($optParams = array())
$params = array_merge($params, $optParams);
return $this->call('get', array($params), "Google_Service_Oauth2_Userinfoplus");
class Google_Service_Oauth2_Jwk extends Google_Collection
protected $collection_key = 'keys';
protected $internal_gapi_mappings = array(
protected $keysType = 'Google_Service_Oauth2_JwkKeys';
protected $keysDataType = 'array';
public function setKeys($keys)
public function getKeys()
class Google_Service_Oauth2_JwkKeys extends Google_Model
protected $internal_gapi_mappings = array(
public function setAlg($alg)
public function setKid($kid)
public function setKty($kty)
public function setUse($use)
class Google_Service_Oauth2_Tokeninfo extends Google_Model
protected $internal_gapi_mappings = array(
"accessType" => "access_type",
"expiresIn" => "expires_in",
"issuedTo" => "issued_to",
"tokenHandle" => "token_handle",
"verifiedEmail" => "verified_email",
public function setAccessType($accessType)
$this->accessType = $accessType;
public function getAccessType()
return $this->accessType;
public function setAudience($audience)
$this->audience = $audience;
public function getAudience()
public function setEmail($email)
public function getEmail()
public function setExpiresIn($expiresIn)
$this->expiresIn = $expiresIn;
public function getExpiresIn()
public function setIssuedTo($issuedTo)
$this->issuedTo = $issuedTo;
public function getIssuedTo()
public function setScope($scope)
public function getScope()
public function setTokenHandle($tokenHandle)
$this->tokenHandle = $tokenHandle;
public function getTokenHandle()
return $this->tokenHandle;
public function setUserId($userId)
public function getUserId()
public function setVerifiedEmail($verifiedEmail)
$this->verifiedEmail = $verifiedEmail;
public function getVerifiedEmail()
return $this->verifiedEmail;
class Google_Service_Oauth2_Userinfoplus extends Google_Model
protected $internal_gapi_mappings = array(
"familyName" => "family_name",
"givenName" => "given_name",
"verifiedEmail" => "verified_email",
public function setEmail($email)
public function getEmail()
public function setFamilyName($familyName)
$this->familyName = $familyName;
public function getFamilyName()
return $this->familyName;
public function setGender($gender)
public function getGender()
public function setGivenName($givenName)
$this->givenName = $givenName;
public function getGivenName()
public function setHd($hd)
public function setId($id)
public function setLink($link)
public function getLink()
public function setLocale($locale)
public function getLocale()
public function setName($name)
public function getName()
public function setPicture($picture)
$this->picture = $picture;
public function getPicture()
public function setVerifiedEmail($verifiedEmail)
$this->verifiedEmail = $verifiedEmail;
public function getVerifiedEmail()
return $this->verifiedEmail;