API Documentation

OpenId/Provider.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_Provider
version
$Id: Provider.php 20096 2010-01-06 02:05:09Z bkarwin $
Classes
Zend_OpenId_Provider

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_Provider

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_Provider
Properties
$_storage
$_user
$_sessionTtl
$_loginUrl
$_trustUrl
$_opEndpoint
Methods
__construct
setOpEndpoint
register
hasUser
login
logout
getLoggedInUser
getSiteRoot
allowSite
denySite
delSite
getTrustedSites
handle
_genSecret
_associate
_checkId
respondToConsumer
_respond
_checkAuthentication

Description

OpenID provider (server) implementation

Properties

$_loginUrl

string $_loginUrl = ''

URL to peform interactive user login

Details

$_loginUrl
string
visibility
private
default
final
false
static
false

$_opEndpoint

string $_opEndpoint = ''

The OP Endpoint URL

Details

$_opEndpoint
string
visibility
private
default
final
false
static
false

$_sessionTtl

integer $_sessionTtl = ''

Time to live of association session in secconds

Details

$_sessionTtl
integer
visibility
private
default
final
false
static
false

$_storage

Zend_OpenId_Provider_Storage $_storage = ''

Reference to an implementation of storage object

Details

$_storage
Zend_OpenId_Provider_Storage
visibility
private
default
final
false
static
false

$_trustUrl

string $_trustUrl = ''

URL to peform interactive validation of consumer by user

Details

$_trustUrl
string
visibility
private
default
final
false
static
false

$_user

Zend_OpenId_Provider_User $_user = ''

Reference to an implementation of user object

Details

$_user
Zend_OpenId_Provider_User
visibility
private
default
final
false
static
false

Methods

__construct

__construct( string $loginUrl = null, string $trustUrl = null, Zend_OpenId_Provider_User $user = null, Zend_OpenId_Provider_Storage $storage = null, integer $sessionTtl = 3600 ) :

Constructs a Zend_OpenId_Provider object with given parameters.

Arguments
$loginUrl
string
is an URL that provides login screen for end-user (by default it is the same URL with additional GET variable openid.action=login)
$trustUrl
string
is an URL that shows a question if end-user trust to given consumer (by default it is the same URL with additional GET variable openid.action=trust)
$user
Zend_OpenId_Provider_User
is an object for communication with User-Agent and store information about logged-in user (it is a Zend_OpenId_Provider_User_Session object by default)
$storage
Zend_OpenId_Provider_Storage
is an object for keeping persistent database (it is a Zend_OpenId_Provider_Storage_File object by default)
$sessionTtl
integer
is a default time to live for association session in seconds (1 hour by default). Consumer must reestablish association after that time.
Details
visibility
public
final
false
static
false

_associate

_associate( float $version, array $params ) : array

Processes association request from OpenID consumerm generates secret shared key and send it back using Diffie-Hellman encruption.

Returns array of variables to push back to consumer.

Arguments
$version
float
OpenID version
$params
array
GET or POST request variables
Output
array
Details
visibility
protected
final
false
static
false

_checkAuthentication

_checkAuthentication( float $version, array $params ) : array

Performs authentication validation for dumb consumers Returns array of variables to push back to consumer.

It MUST contain 'is_valid' variable with value 'true' or 'false'.

Arguments
$version
float
OpenID version
$params
array
GET or POST request variables
Output
array
Details
visibility
protected
final
false
static
false

_checkId

_checkId( float $version, array $params, bool $immediate, mixed $extensions = null, Zend_Controller_Response_Abstract $response = null ) : array

Performs authentication (or authentication check).

Arguments
$version
float
OpenID version
$params
array
GET or POST request variables
$immediate
bool
enables or disables interaction with user
$extensions
mixed
extension object or array of extensions objects
$response
Zend_Controller_Response_Abstract
Output
array
Details
visibility
protected
final
false
static
false

_genSecret

_genSecret( string $func ) : mixed

Generates a secret key for given hash function, returns RAW key or false if function is not supported

Arguments
$func
string
hash function (sha1 or sha256)
Output
mixed
Details
visibility
protected
final
false
static
false

_respond

_respond( float $version, array $ret, array $params, mixed $extensions = null ) : array

Perepares information to send back to consumer's authentication request and signs it using shared secret.

Arguments
$version
float
OpenID protcol version
$ret
array
arguments to be send back to consumer
$params
array
GET or POST request variables
$extensions
mixed
extension object or array of extensions objects
Output
array
Details
visibility
protected
final
false
static
false

allowSite

allowSite( string $root, mixed $extensions = null ) : bool

Allows consumer with given root URL to authenticate current logged in user. Returns true on success and false on error.

Arguments
$root
string
root URL
$extensions
mixed
extension object or array of extensions objects
Output
bool
Details
visibility
public
final
false
static
false

delSite

delSite( string $root ) : bool

Delete consumer with given root URL from known sites of current logged in user. Next time this consumer will try to authenticate the user, Provider will ask user's confirmation.

Returns true on success and false on error.

Arguments
$root
string
root URL
Output
bool
Details
visibility
public
final
false
static
false

denySite

denySite( string $root ) : bool

Prohibit consumer with given root URL to authenticate current logged in user. Returns true on success and false on error.

Arguments
$root
string
root URL
Output
bool
Details
visibility
public
final
false
static
false

getLoggedInUser

getLoggedInUser( ) : mixed

Returns identity URL of current logged in user or false

Output
mixed
Details
visibility
public
final
false
static
false

getSiteRoot

getSiteRoot( array $params ) : mixed

Retrieve consumer's root URL from request query.

Returns URL or false in case of failure

Arguments
$params
array
query arguments
Output
mixed
Details
visibility
public
final
false
static
false

getTrustedSites

getTrustedSites( ) : mixed

Returns list of known consumers for current logged in user or false if he is not logged in.

Output
mixed
Details
visibility
public
final
false
static
false

handle

handle( array $params = null, mixed $extensions = null, Zend_Controller_Response_Abstract $response = null ) : mixed

Handles HTTP request from consumer

Arguments
$params
array
GET or POST variables. If this parameter is omited or set to null, then $_GET or $_POST superglobal variable is used according to REQUEST_METHOD.
$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
mixed
Details
visibility
public
final
false
static
false

hasUser

hasUser( string $id ) : bool

Returns true if user with given $id exists and false otherwise

Arguments
$id
string
user identity URL
Output
bool
Details
visibility
public
final
false
static
false

login

login( string $id, string $password ) : bool

Performs login of user with given $id and $password Returns true in case of success and false otherwise

Arguments
$id
string
user identity URL
$password
string
user password
Output
bool
Details
visibility
public
final
false
static
false

logout

logout( ) : void

Performs logout. Clears information about logged in user.

Details
visibility
public
final
false
static
false

register

register( string $id, string $password ) : bool

Registers a new user with given $id and $password Returns true in case of success and false if user with given $id already exists

Arguments
$id
string
user identity URL
$password
string
encoded user password
Output
bool
Details
visibility
public
final
false
static
false

respondToConsumer

respondToConsumer( array $params, mixed $extensions = null, Zend_Controller_Response_Abstract $response = null ) : bool

Perepares information to send back to consumer's authentication request, signs it using shared secret and send back through HTTP redirection

Arguments
$params
array
GET or POST request variables
$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

setOpEndpoint

setOpEndpoint( string $url ) : null

Sets the OP Endpoint URL

Arguments
$url
string
the OP Endpoint URL
Output
null
Details
visibility
public
final
false
static
false
Documentation was generated by DocBlox.