Wrapper around Zend_Http_Client to facilitate Google's "Account Authentication Proxy for Web-Based Applications".

see
category Zend
package Zend_Gdata
subpackage Gdata
copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
license New BSD License

 Methods

Revoke a token

AuthSubRevokeToken(string $token, \Zend_Http_Client $client = null, string $request_uri = self::AUTHSUB_REVOKE_TOKEN_URI) : boolean
Static

Parameters

$token

string

The token to revoke

$client

\Zend_Http_Client

(optional) HTTP client to use to make the request

$request_uri

string

(optional) URI to which to direct the revokation request

Exceptions

\Zend_Gdata_App_HttpException

Returns

booleanWhether the revokation was successful

Upgrades a single use token to a session token

getAuthSubSessionToken(string $token, \Zend_Http_Client $client = null, string $request_uri = self::AUTHSUB_SESSION_TOKEN_URI) : string
Static

Parameters

$token

string

The single use token which is to be upgraded

$client

\Zend_Http_Client

(optional) HTTP client to use to make the request

$request_uri

string

(optional) URI to which to direct the session token upgrade

Exceptions

\Zend_Gdata_App_AuthException
\Zend_Gdata_App_HttpException

Returns

stringThe upgraded token value

get token information

getAuthSubTokenInfo(string $token, \Zend_Http_Client $client = null, string $request_uri = self::AUTHSUB_TOKEN_INFO_URI
Static

Parameters

$token

string

The token to retrieve information about

$client

\Zend_Http_Client

(optional) HTTP client to use to make the request

$request_uri

string

(optional) URI to which to direct the information request

Creates a URI to request a single-use AuthSub token.

getAuthSubTokenUri(string $next, string $scope, integer $secure = 0, integer $session = 0, string $request_uri = self::AUTHSUB_REQUEST_URI
Static

Parameters

$next

string

(required) URL identifying the service to be accessed. The resulting token will enable access to the specified service only. Some services may limit scope further, such as read-only access.

$scope

string

(required) URL identifying the service to be accessed. The resulting token will enable access to the specified service only. Some services may limit scope further, such as read-only access.

$secure

integer

(optional) Boolean flag indicating whether the authentication transaction should issue a secure token (1) or a non-secure token (0). Secure tokens are available to registered applications only.

$session

integer

(optional) Boolean flag indicating whether the one-time-use token may be exchanged for a session token (1) or not (0).

$request_uri

string

(optional) URI to which to direct the authentication request.

Retrieve a HTTP client object with AuthSub credentials attached as the Authorization header

getHttpClient(string $token, \Zend_Gdata_HttpClient $client = null
Static

Parameters

$token

string

The token to retrieve information about

$client

\Zend_Gdata_HttpClient

(optional) HTTP client to use to make the request

 Constants

 

AUTHSUB_REQUEST_URI

AUTHSUB_REQUEST_URI = 'https://www.google.com/accounts/AuthSubRequest' 
 

AUTHSUB_REVOKE_TOKEN_URI

AUTHSUB_REVOKE_TOKEN_URI = 'https://www.google.com/accounts/AuthSubRevokeToken' 
 

AUTHSUB_SESSION_TOKEN_URI

AUTHSUB_SESSION_TOKEN_URI = 'https://www.google.com/accounts/AuthSubSessionToken' 
 

AUTHSUB_TOKEN_INFO_URI

AUTHSUB_TOKEN_INFO_URI = 'https://www.google.com/accounts/AuthSubTokenInfo'