API Documentation

OpenId/Consumer.php

Includes Classes 
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_OpenId
subpackage
Zend_OpenId_Consumer
version
$Id: Consumer.php 20096 2010-01-06 02:05:09Z bkarwin $
Classes
Zend_OpenId_Consumer

Description

Zend Framework

LICENSE

This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.

Zend_OpenId_Consumer

category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_OpenId
subpackage
Zend_OpenId_Consumer
Properties
$_storage
$_dumbMode
$_cache
$_httpClient
$_session
$_error
Methods
__construct
login
check
verify
_addAssociation
_getAssociation
_httpRequest
_associate
_discovery
_checkId
setHttpClient
getHttpClient
setSession
getSession
_setError
getError

Description

OpenID consumer implementation

Properties

$_cache

array $_cache = 'array'

Internal cache to prevent unnecessary access to storage

Details

$_cache
array
visibility
protected
default
array
final
false
static
false

$_dumbMode

Zend_OpenId_Consumer_Storage $_dumbMode = 'false'

Enables or disables consumer to use association with server based on Diffie-Hellman key agreement

Details

$_dumbMode
Zend_OpenId_Consumer_Storage
visibility
protected
default
false
final
false
static
false

$_error

string $_error = ''

Last error message for logi, check or verify failure

Details

$_error
string
visibility
private
default
final
false
static
false

$_httpClient

Zend_Http_Client $_httpClient = 'null'

HTTP client to make HTTP requests

Details

$_httpClient
Zend_Http_Client
visibility
private
default
null
final
false
static
false

$_session

Zend_Session_Namespace $_session = 'null'

HTTP session to store climed_id between requests

Details

$_session
Zend_Session_Namespace
visibility
private
default
null
final
false
static
false

$_storage

Zend_OpenId_Consumer_Storage $_storage = 'null'

Reference to an implementation of storage object

Details

$_storage
Zend_OpenId_Consumer_Storage
visibility
protected
default
null
final
false
static
false

Methods

__construct

__construct( Zend_OpenId_Consumer_Storage $storage = null, bool $dumbMode = false ) :

Constructs a Zend_OpenId_Consumer object with given $storage.

Enables or disables future association with server based on Diffie-Hellman key agreement.

Arguments
$storage
Zend_OpenId_Consumer_Storage
implementation of custom storage object
$dumbMode
bool
Enables or disables consumer to use association with server based on Diffie-Hellman key agreement
Details
visibility
public
final
false
static
false

_addAssociation

_addAssociation( string $url, string $handle, string $macFunc, string $secret, integer $expires ) : void

Store assiciation in internal chace and external storage

Arguments
$url
string
OpenID server url
$handle
string
association handle
$macFunc
string
HMAC function (sha1 or sha256)
$secret
string
shared secret
$expires
integer
expiration UNIX time
Details
visibility
protected
final
false
static
false

_associate

_associate( string $url, float $version, string $priv_key = null ) : bool

Create (or reuse existing) association between OpenID consumer and OpenID server based on Diffie-Hellman key agreement. Returns true on success and false on failure.

Arguments
$url
string
OpenID server url
$version
float
OpenID protocol version
$priv_key
string
for testing only
Output
bool
Details
visibility
protected
final
false
static
false

_checkId

_checkId( bool $immediate, string $id, string $returnTo = null, string $root = null, mixed $extensions = null, Zend_Controller_Response_Abstract $response = null ) : bool

Performs check of OpenID identity.

This is the first step of OpenID authentication process. On success the function does not return (it does HTTP redirection to server and exits). On failure it returns false.

Arguments
$immediate
bool
enables or disables interaction with user
$id
string
OpenID identity
$returnTo
string
HTTP URL to redirect response from server to
$root
string
HTTP URL to identify consumer on server
$extensions
mixed
extension object or array of extensions objects
$response
Zend_Controller_Response_Abstract
an optional response object to perform HTTP or HTML form redirection
Output
bool
Details
visibility
protected
final
false
static
false

_discovery

_discovery( string $id, string $server, float $version ) : bool

Performs discovery of identity and finds OpenID URL, OpenID server URL and OpenID protocol version. Returns true on succees and false on failure.

Arguments
$id
string
&$id OpenID identity URL
$server
string
&$server OpenID server URL
$version
float
&$version OpenID protocol version
Output
bool
Details
visibility
protected
final
false
static
false
todo
OpenID 2.0 (7.3) XRI and Yadis discovery

_getAssociation

_getAssociation( string $url, string $handle, string $macFunc, string $secret, integer $expires ) : void

Retrive assiciation information for given $url from internal cahce or external storage

Arguments
$url
string
OpenID server url
$handle
string
&$handle association handle
$macFunc
string
&$macFunc HMAC function (sha1 or sha256)
$secret
string
&$secret shared secret
$expires
integer
&$expires expiration UNIX time
Details
visibility
protected
final
false
static
false

_httpRequest

_httpRequest( string $url, string $method = GET, array $params = array, int $status = null ) : mixed

Performs HTTP request to given $url using given HTTP $method.

Send additinal query specified by variable/value array, On success returns HTTP response without headers, false on failure.

Arguments
$url
string
OpenID server url
$method
string
HTTP request method 'GET' or 'POST'
$params
array
additional qwery parameters to be passed with
$status
int
&$staus HTTP status code request
Output
mixed
Details
visibility
protected
final
false
static
false

_setError

_setError( string $message ) :

Saves error message

Arguments
$message
string
error message
Details
visibility
protected
final
false
static
false

check

check( string $id, string $returnTo = null, string $root = null, mixed $extensions = null, Zend_Controller_Response_Abstract $response = null ) : bool

Performs immediate check (without user interaction) of OpenID identity.

This is the first step of OpenID authentication process. On success the function does not return (it does HTTP redirection to server and exits). On failure it returns false.

Arguments
$id
string
OpenID identity
$returnTo
string
HTTP URL to redirect response from server to
$root
string
HTTP URL to identify consumer on server
$extensions
mixed
extension object or array of extensions objects
$response
Zend_Controller_Response_Abstract
an optional response object to perform HTTP or HTML form redirection
Output
bool
Details
visibility
public
final
false
static
false

getError

getError( ) : string

Returns error message that explains failure of login, check or verify

Output
string
Details
visibility
public
final
false
static
false

getHttpClient

getHttpClient( ) : Zend_Http_Client

Returns HTTP client object that will be used to make HTTP requests

Details
visibility
public
final
false
static
false

getSession

getSession( ) : Zend_Session_Namespace

Returns session object that is used to store climed_id

Details
visibility
public
final
false
static
false

login

login( string $id, string $returnTo = null, string $root = null, mixed $extensions = null, Zend_Controller_Response_Abstract $response = null ) : bool

Performs check (with possible user interaction) of OpenID identity.

This is the first step of OpenID authentication process. On success the function does not return (it does HTTP redirection to server and exits). On failure it returns false.

Arguments
$id
string
OpenID identity
$returnTo
string
URL to redirect response from server to
$root
string
HTTP URL to identify consumer on server
$extensions
mixed
extension object or array of extensions objects
$response
Zend_Controller_Response_Abstract
an optional response object to perform HTTP or HTML form redirection
Output
bool
Details
visibility
public
final
false
static
false

setHttpClient

setHttpClient( Zend_Http_Client $client ) :

Sets HTTP client object to make HTTP requests

Arguments
$client
Zend_Http_Client
HTTP client object to be used
Details
visibility
public
final
false
static
false

setSession

setSession( Zend_Session_Namespace $session ) :

Sets session object to store climed_id

Arguments
$session
Zend_Session_Namespace
HTTP client object to be used
Details
visibility
public
final
false
static
false

verify

verify( array $params, string $identity, mixed $extensions = null ) : bool

Verifies authentication response from OpenID server.

This is the second step of OpenID authentication process. The function returns true on successful authentication and false on failure.

Arguments
$params
array
HTTP query data from OpenID server
$identity
string
&$identity this argument is set to end-user's claimed identifier or OpenID provider local identifier.
$extensions
mixed
extension object or array of extensions objects
Output
bool
Details
visibility
public
final
false
static
false
Documentation was generated by DocBlox.