OpenID
[ class tree: OpenID ] [ index: OpenID ] [ all elements ]

Class: OpenID_Auth_Request

Source Location: /OpenID-0.4.0/OpenID/Auth/Request.php

Class Overview


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


Author(s):

Copyright:

  • 2009 Bill Shupp

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 66]
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());



[ Top ]


Class Variables

$discover =  null

[line 102]

The original OpenID_Discover object. Useful for detecting extension support

Type:   OpenID_Discover|null


[ Top ]

$identifier =  null

[line 73]

The normalized identifier
  • Access: protected

Type:   string


[ Top ]

$message =  null

[line 80]

The request message
  • Access: protected

Type:   OpenID_Message


[ Top ]

$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

Type:   OpenID_Nonce


[ Top ]

$serviceEndpoint =  null

[line 87]

The OP Endpoint we are communicating with
  • Access: protected



[ Top ]



Method Detail

__construct (Constructor)   [line 115]

void __construct( OpenID_Discover $discover, string $returnTo, string $realm, [string $assocHandle = null])

Sets the basic information used in the message.
  • Access: public

Parameters:

OpenID_Discover   $discover   —  Discover object
string   $returnTo   —  The return_to URL
string   $realm   —  The realm
string   $assocHandle   —  The optional association handle

[ Top ]

addExtension   [line 146]

void addExtension( OpenID_Extension $extension)

Adds an extension to the message.
  • Access: public

Parameters:

OpenID_Extension   $extension   —  Extension instance

[ Top ]

addNonce   [line 260]

void addNonce( )

Adds a nonce to the openid.return_to URL parameter. Only used in OpenID 1.1
  • Access: protected

[ Top ]

getAuthorizeURL   [line 191]

string getAuthorizeURL( )

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

[ Top ]

getDiscover   [line 284]

OpenID_Discover|null getDiscover( )

Returns the discovered information about the identifer

[ Top ]

getMode   [line 180]

string getMode( )

Gets the current openid.mode value
  • Access: public

[ Top ]

getNonce   [line 245]

OpenID_Nonce getNonce( )

Gets the OpenID_Nonce instance if set, otherwise instantiates one.
  • Access: protected

[ Top ]

setMode   [line 160]

void setMode( mixed $mode)

Sets the openid.mode parameter. Can be either "checkid_setup" or "checkid_immediate"
  • Throws: OpenID_Auth_Exception on an invalid mode
  • Access: public

Parameters:

mixed   $mode   —  Value for 'openid.mode'

[ Top ]

setNonce   [line 235]

void setNonce( OpenID_Nonce $nonce)

Sets the instance of OpenID_Nonce for use with 1.1 return_to nonces
  • Access: public

Parameters:

OpenID_Nonce   $nonce   —  Custom instance of OpenID_Nonce

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:57:49 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.