Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions | Private Attributes

OpenIdConsumer Class Reference
[OpenId implementation]

openId consumer library entry point More...

List of all members.

Public Member Functions

 __construct (RandomSource $randomSource, BigNumberFactory $numberFactory, HttpClient $httpClient)
 associate (HttpUrl $server, OpenIdConsumerAssociationManager $manager)
 "associate" mode request
 checkIdImmediate (OpenIdCredentials $credentials, HttpUrl $returnTo, $trustRoot=null, $association=null)
 "checkid_immediate" mode request
 checkIdSetup (OpenIdCredentials $credentials, HttpUrl $returnTo, $trustRoot=null, $association=null)
 "checkid_setup" mode request
 doContinue (HttpRequest $request, $manager=null)
 proceed results of checkid_immediate and checkid_setup
 addExtension (OpenIdExtension $extension)

Static Public Member Functions

static create (RandomSource $randomSource, BigNumberFactory $numberFactory, HttpClient $httpClient)

Public Attributes

const DIFFIE_HELLMAN_P = '155172898181473697471232257763715539915724801966915404479707795314057629378541917580651227423698188993727816152646631438561595825688188889951272158842675419950341258706556549803580104870537681476726513255747040765857479291291572334510643245094715007229621094194349783925984760375594985848253359305585439638443'
const DIFFIE_HELLMAN_G = 2
const ASSOCIATION_TYPE = 'HMAC-SHA1'
const NAMESPACE_2_0 = 'http://specs.openid.net/auth/2.0'

Private Member Functions

 makeCheckIdRequest (OpenIdCredentials $credentials, HttpUrl $returnTo, $trustRoot=null, $association=null)
 checkAuthentication (array $parameters, $manager=null)
 check_authentication mode request
 parseKeyValueFormat ($raw)
 parseGetParameters (array $get)

Private Attributes

 $extensions = array()
 $randomSource = null
 $numberFactory = null
 $httpClient = null

Detailed Description

openId consumer library entry point

See also:
http://openid.net/specs/openid-authentication-1_1.html
Todo:
use nonce to limit time frame of replay attacks

Definition at line 20 of file OpenIdConsumer.class.php.


Constructor & Destructor Documentation

OpenIdConsumer::__construct ( RandomSource randomSource,
BigNumberFactory numberFactory,
HttpClient httpClient 
)

Definition at line 37 of file OpenIdConsumer.class.php.


Member Function Documentation

OpenIdConsumer::addExtension ( OpenIdExtension extension  ) 
Parameters:
OpenIdExtension $extension
Returns:
OpenIdConsumer

Definition at line 399 of file OpenIdConsumer.class.php.

OpenIdConsumer::associate ( HttpUrl server,
OpenIdConsumerAssociationManager manager 
)

"associate" mode request

Parameters:
$server to make association with (usually obtained from OpenIdCredentials)
$manager - dao-like association manager
Returns:
OpenIdConsumerAssociation

Definition at line 67 of file OpenIdConsumer.class.php.

References HttpStatus::CODE_200, create(), OpenIdConsumerAssociationManager::findByServer(), DiffieHellmanKeyPair::generate(), Assert::isTrue(), Url::isValid(), OpenIdConsumerAssociationManager::makeAndSave(), Timestamp::makeNow(), parseKeyValueFormat(), and HttpMethod::post().

Here is the call graph for this function:

OpenIdConsumer::checkAuthentication ( array $  parameters,
manager = null 
) [private]

check_authentication mode request

Definition at line 409 of file OpenIdConsumer.class.php.

References HttpStatus::CODE_200, create(), HttpUrl::create(), Assert::isUnreachable(), parseKeyValueFormat(), and HttpMethod::post().

Referenced by doContinue().

Here is the call graph for this function:

OpenIdConsumer::checkIdImmediate ( OpenIdCredentials credentials,
HttpUrl returnTo,
trustRoot = null,
association = null 
)

"checkid_immediate" mode request

Parameters:
$credentials - id and server urls
$returnTo - URL where the provider should return the User-Agent back to
$trustRoot - URL the Provider shall ask the End User to trust
$association - result of associate call in smart mode
Returns:
ModelAndView

Definition at line 244 of file OpenIdConsumer.class.php.

References makeCheckIdRequest().

Here is the call graph for this function:

OpenIdConsumer::checkIdSetup ( OpenIdCredentials credentials,
HttpUrl returnTo,
trustRoot = null,
association = null 
)

"checkid_setup" mode request

Parameters:
$credentials - id and server urls
$returnTo - URL where the provider should return the User-Agent back to
$trustRoot - URL the Provider shall ask the End User to trust
$association - result of associate call in smart mode
Returns:
ModelAndView

Definition at line 273 of file OpenIdConsumer.class.php.

References makeCheckIdRequest().

Here is the call graph for this function:

static OpenIdConsumer::create ( RandomSource randomSource,
BigNumberFactory numberFactory,
HttpClient httpClient 
) [static]
OpenIdConsumer::doContinue ( HttpRequest request,
manager = null 
)

proceed results of checkid_immediate and checkid_setup

Parameters:
$request incoming request
 

Definition at line 299 of file OpenIdConsumer.class.php.

References checkAuthentication(), create(), HttpRequest::getGet(), CryptoFunctions::hmacsha1(), Assert::isTrue(), Assert::isUnreachable(), and parseGetParameters().

Here is the call graph for this function:

OpenIdConsumer::makeCheckIdRequest ( OpenIdCredentials credentials,
HttpUrl returnTo,
trustRoot = null,
association = null 
) [private]

Definition at line 167 of file OpenIdConsumer.class.php.

References create(), OpenIdCredentials::getRealId(), OpenIdCredentials::getServer(), Assert::isTrue(), Url::isValid(), and GenericUri::toString().

Referenced by checkIdImmediate(), and checkIdSetup().

Here is the call graph for this function:

OpenIdConsumer::parseGetParameters ( array $  get  )  [private]

Definition at line 492 of file OpenIdConsumer.class.php.

Referenced by doContinue().

OpenIdConsumer::parseKeyValueFormat ( raw  )  [private]

Definition at line 477 of file OpenIdConsumer.class.php.

Referenced by associate(), and checkAuthentication().


Member Data Documentation

OpenIdConsumer::$extensions = array() [private]

Definition at line 27 of file OpenIdConsumer.class.php.

OpenIdConsumer::$httpClient = null [private]

Definition at line 35 of file OpenIdConsumer.class.php.

OpenIdConsumer::$numberFactory = null [private]

Definition at line 30 of file OpenIdConsumer.class.php.

OpenIdConsumer::$randomSource = null [private]

Definition at line 29 of file OpenIdConsumer.class.php.

const OpenIdConsumer::ASSOCIATION_TYPE = 'HMAC-SHA1'

Definition at line 24 of file OpenIdConsumer.class.php.

Definition at line 23 of file OpenIdConsumer.class.php.

const OpenIdConsumer::DIFFIE_HELLMAN_P = '155172898181473697471232257763715539915724801966915404479707795314057629378541917580651227423698188993727816152646631438561595825688188889951272158842675419950341258706556549803580104870537681476726513255747040765857479291291572334510643245094715007229621094194349783925984760375594985848253359305585439638443'

Definition at line 22 of file OpenIdConsumer.class.php.

const OpenIdConsumer::NAMESPACE_2_0 = 'http://specs.openid.net/auth/2.0'

Definition at line 25 of file OpenIdConsumer.class.php.


The documentation for this class was generated from the following file: