summaryrefslogtreecommitdiffstats
path: root/Auth/OpenID
diff options
context:
space:
mode:
authortailor <cygnus@janrain.com>2007-01-12 22:04:16 +0000
committertailor <cygnus@janrain.com>2007-01-12 22:04:16 +0000
commit2ebb376aeb9676fba1459d7f33a015de49f2f443 (patch)
tree1e4cf383f1c94a5941e68505862e2f54f7ba161f /Auth/OpenID
parent1dce056e69206f1d1f2f1f42e48c4d9e16e60760 (diff)
downloadphp-openid-2ebb376aeb9676fba1459d7f33a015de49f2f443.zip
php-openid-2ebb376aeb9676fba1459d7f33a015de49f2f443.tar.gz
php-openid-2ebb376aeb9676fba1459d7f33a015de49f2f443.tar.bz2
[project @ Move OpenID 1 nonce name to constant, reorder authrequest constructor args]
Diffstat (limited to 'Auth/OpenID')
-rw-r--r--Auth/OpenID/Consumer.php17
1 files changed, 11 insertions, 6 deletions
diff --git a/Auth/OpenID/Consumer.php b/Auth/OpenID/Consumer.php
index 99a30db..9cf86f0 100644
--- a/Auth/OpenID/Consumer.php
+++ b/Auth/OpenID/Consumer.php
@@ -209,6 +209,11 @@ define('Auth_OpenID_SETUP_NEEDED', 'setup needed');
define('Auth_OpenID_PARSE_ERROR', 'parse error');
/**
+ * Nonce name for OpenID 1.
+ */
+define('Auth_OpenID_NONCE_NAME', 'janrain_nonce');
+
+/**
* An OpenID consumer implementation that performs discovery and does
* session management. See the Consumer.php file documentation for
* more information.
@@ -516,10 +521,9 @@ class Auth_OpenID_GenericConsumer {
function begin($service_endpoint)
{
- $nonce = Auth_OpenID_mkNonce();
$assoc = $this->_getAssociation($service_endpoint->server_url);
- $r = new Auth_OpenID_AuthRequest($assoc, $service_endpoint);
- $r->return_to_args['nonce'] = $nonce;
+ $r = new Auth_OpenID_AuthRequest($service_endpoint, $assoc);
+ $r->return_to_args[Auth_OpenID_NONCE_NAME] = Auth_OpenID_mkNonce();
return $r;
}
@@ -755,7 +759,7 @@ class Auth_OpenID_GenericConsumer {
$found = false;
foreach ($query as $k => $v) {
- if ($k == 'nonce') {
+ if ($k == Auth_OpenID_NONCE_NAME) {
$server_url = '';
$nonce = $v;
$found = true;
@@ -931,7 +935,7 @@ class Auth_OpenID_AuthRequest {
* class. Instances of this class are created by the library when
* needed.
*/
- function Auth_OpenID_AuthRequest($assoc, $endpoint)
+ function Auth_OpenID_AuthRequest($endpoint, $assoc)
{
$this->assoc = $assoc;
$this->endpoint = $endpoint;
@@ -1118,7 +1122,8 @@ class Auth_OpenID_SuccessResponse extends Auth_OpenID_ConsumerResponse {
function getNonce()
{
- return $this->getSigned(Auth_OpenID_OPENID_NS, 'nonce');
+ return $this->getSigned(Auth_OpenID_OPENID_NS,
+ Auth_OpenID_NONCE_NAME);
}
}