Class OpenID_Auth_Request

Description

Creates an OpenID authorization request of type "checkid_setup" or "checkid_immediate".

Example:

  1.  // First perform discovery on the user supplied identifier
  2.  $discover new OpenID_Discover($identifier);
  3.  $discover->discover();
  4.  
  5.  // Optionally get association (from cache in this example)
  6.  $opEndpointURL array_shift($discover->services[0]->getURIs());
  7.  $assocHandle   OpenID::getStore()->getAssociation($opEndpointURL)->assocHandle;
  8.  
  9.  // Now create the auth request object
  10.  $auth new OpenID_Auth_Request($discover,     // OpenID_Discover object
  11.                                  $returnTo,     // openid.return_to
  12.                                  $realm,        // openid.realm
  13.                                  $assocHandle)// openid.assoc_handle
  14.  
  15.  // Optionally add an extension
  16.   $sreg new OpenID_Extension_SREG11(OpenID_Extension::REQUEST);
  17.   $sreg->set('required''email');
  18.   $sreg->set('optional''nickname,gender,dob');
  19.  
  20.   // Add it to an existing instance of OpenID_Auth_Request
  21.   $auth->addExtension($sreg);
  22.  
  23.  // Optionally make this a checkid_immediate request
  24.  $auth->setMode(OpenID::MODE_CHECKID_IMMEDIATE);
  25.  
  26.  // Send user to the OP
  27.  header('Location: ' $auth->getAuthorizeURL());

Located in /OpenID/Auth/Request.php (line 66)


	
			
Variable Summary
Method Summary
void __construct (OpenID_Discover $discover, string $returnTo, string $realm, [string $assocHandle = null])
void addExtension (OpenID_Extension $extension)
void addNonce ()
string getAuthorizeURL ()
string getMode ()
void setMode (mixed $mode)
void setNonce (OpenID_Nonce $nonce)
Variables
string $identifier = null (line 73)

The normalized identifier

  • access: protected
OpenID_Message $message = null (line 80)

The request message

  • access: protected
OpenID_Nonce $nonce = null (line 94)

Nonce class in case we are in 1.1 mode and need to embed it in the return_to

  • access: protected
OpenID_ServiceEndpoint $serviceEndpoint = null (line 87)

The OP Endpoint we are communicating with

  • access: protected
Methods
Constructor __construct (line 107)

Sets the basic information used in the message.

  • access: public
void __construct (OpenID_Discover $discover, string $returnTo, string $realm, [string $assocHandle = null])
  • OpenID_Discover $discover: Discover object
  • string $returnTo: The return_to URL
  • string $realm: The realm
  • string $assocHandle: The optional association handle
addExtension (line 139)

Adds an extension to the message.

  • access: public
void addExtension (OpenID_Extension $extension)
addNonce (line 246)

Adds a nonce to the openid.return_to URL parameter. Only used in OpenID 1.1

  • access: protected
void addNonce ()
getAuthorizeURL (line 183)

Gets the auth request message in a URL format suitable for redirection. The decision about whether to use directed identity or not id done here.

  • return: The URL to redirect the User-Agent to
  • access: public
string getAuthorizeURL ()
getMode (line 172)

Gets the current openid.mode value

  • access: public
string getMode ()
getNonce (line 233)

Gets the OpenID_Nonce instance if set, otherwise instantiates one.

  • access: protected
OpenID_Nonce getNonce ()
setMode (line 153)

Sets the openid.mode parameter. Can be either "checkid_setup" or "checkid_immediate"

  • throws: OpenID_Auth_Exception on an invalid mode
  • access: public
void setMode (mixed $mode)
  • mixed $mode: Value for 'openid.mode'
setNonce (line 223)

Sets the instance of OpenID_Nonce for use with 1.1 return_to nonces

  • access: public
void setNonce (OpenID_Nonce $nonce)

Documentation generated on Tue, 15 Dec 2009 19:00:58 -0800 by phpDocumentor 1.4.3