ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
Auth_OpenID_AuthRequest Class Reference
+ Collaboration diagram for Auth_OpenID_AuthRequest:

Public Member Functions

 Auth_OpenID_AuthRequest ($endpoint, $assoc)
 Initialize an authentication request with the specified token, association, and endpoint.
 addExtension ($extension_request)
 Add an extension to this checkid request.
 addExtensionArg ($namespace, $key, $value)
 Add an extension argument to this OpenID authentication request.
 setAnonymous ($is_anonymous)
 Set whether this request should be made anonymously.
 getMessage ($realm, $return_to=null, $immediate=false)
 Produce a Auth_OpenID_Message representing this request.
 redirectURL ($realm, $return_to=null, $immediate=false)
 formMarkup ($realm, $return_to=null, $immediate=false, $form_tag_attrs=null)
 Get html for a form to submit this request to the IDP.
 htmlMarkup ($realm, $return_to=null, $immediate=false, $form_tag_attrs=null)
 Get a complete html document that will autosubmit the request to the IDP.
 shouldSendRedirect ()

Detailed Description

Definition at line 1741 of file Consumer.php.

Member Function Documentation

Auth_OpenID_AuthRequest::addExtension (   $extension_request)

Add an extension to this checkid request.

$extension_request: An object that implements the extension request interface for adding arguments to an OpenID message.

Definition at line 1767 of file Consumer.php.

{
$extension_request->toMessage($this->message);
}
Auth_OpenID_AuthRequest::addExtensionArg (   $namespace,
  $key,
  $value 
)

Add an extension argument to this OpenID authentication request.

Use caution when adding arguments, because they will be URL-escaped and appended to the redirect URL, which can easily get quite long.

Parameters
string$namespaceThe namespace for the extension. For example, the simple registration extension uses the namespace 'sreg'.
string$keyThe key within the extension namespace. For example, the nickname field in the simple registration extension's key is 'nickname'.
string$valueThe value to provide to the server for this argument.

Definition at line 1791 of file Consumer.php.

References $namespace.

{
return $this->message->setArg($namespace, $key, $value);
}
Auth_OpenID_AuthRequest::Auth_OpenID_AuthRequest (   $endpoint,
  $assoc 
)

Initialize an authentication request with the specified token, association, and endpoint.

Users of this library should not create instances of this class. Instances of this class are created by the library when needed.

Definition at line 1751 of file Consumer.php.

{
$this->assoc = $assoc;
$this->endpoint = $endpoint;
$this->return_to_args = array();
$this->message = new Auth_OpenID_Message(
$endpoint->preferredNamespace());
$this->_anonymous = false;
}
Auth_OpenID_AuthRequest::formMarkup (   $realm,
  $return_to = null,
  $immediate = false,
  $form_tag_attrs = null 
)

Get html for a form to submit this request to the IDP.

form_tag_attrs: An array of attributes to be added to the form tag. 'accept-charset' and 'enctype' have defaults that can be overridden. If a value is supplied for 'action' or 'method', it will be replaced.

Definition at line 1928 of file Consumer.php.

References getMessage(), and Auth_OpenID\isFailure().

Referenced by htmlMarkup().

{
$message = $this->getMessage($realm, $return_to, $immediate);
if (Auth_OpenID::isFailure($message)) {
return $message;
}
return $message->toFormMarkup($this->endpoint->server_url,
$form_tag_attrs);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Auth_OpenID_AuthRequest::getMessage (   $realm,
  $return_to = null,
  $immediate = false 
)

Produce a Auth_OpenID_Message representing this request.

Parameters
string$realmThe URL (or URL pattern) that identifies your web site to the user when she is authorizing it.
string$return_toThe URL that the OpenID provider will send the user back to after attempting to verify her identity.

Not specifying a return_to URL means that the user will not be returned to the site issuing the request upon its completion.

Parameters
bool$immediateIf true, the OpenID provider is to send back a response immediately, useful for behind-the-scenes authentication attempts. Otherwise the OpenID provider may engage the user before providing a response. This is the default case, as the user may need to provide credentials or approve the request before a positive response can be sent.

Definition at line 1835 of file Consumer.php.

References Auth_OpenID\appendArgs(), Auth_OpenID_IDENTIFIER_SELECT, Auth_OpenID_OPENID2_NS, and Auth_OpenID_OPENID_NS.

Referenced by formMarkup(), and redirectURL().

{
if ($return_to) {
$return_to = Auth_OpenID::appendArgs($return_to,
$this->return_to_args);
} else if ($immediate) {
// raise ValueError(
// '"return_to" is mandatory when
//using "checkid_immediate"')
return new Auth_OpenID_FailureResponse(null,
"'return_to' is mandatory when using checkid_immediate");
} else if ($this->message->isOpenID1()) {
// raise ValueError('"return_to" is
// mandatory for OpenID 1 requests')
return new Auth_OpenID_FailureResponse(null,
"'return_to' is mandatory for OpenID 1 requests");
} else if ($this->return_to_args) {
// raise ValueError('extra "return_to" arguments
// were specified, but no return_to was specified')
return new Auth_OpenID_FailureResponse(null,
"extra 'return_to' arguments where specified, " .
"but no return_to was specified");
}
if ($immediate) {
$mode = 'checkid_immediate';
} else {
$mode = 'checkid_setup';
}
$message = $this->message->copy();
if ($message->isOpenID1()) {
$realm_key = 'trust_root';
} else {
$realm_key = 'realm';
}
$message->updateArgs(Auth_OpenID_OPENID_NS,
array(
$realm_key => $realm,
'mode' => $mode,
'return_to' => $return_to));
if (!$this->_anonymous) {
if ($this->endpoint->isOPIdentifier()) {
// This will never happen when we're in compatibility
// mode, as long as isOPIdentifier() returns False
// whenever preferredNamespace() returns OPENID1_NS.
$claimed_id = $request_identity =
} else {
$request_identity = $this->endpoint->getLocalID();
$claimed_id = $this->endpoint->claimed_id;
}
// This is true for both OpenID 1 and 2
$message->setArg(Auth_OpenID_OPENID_NS, 'identity',
$request_identity);
if ($message->isOpenID2()) {
$message->setArg(Auth_OpenID_OPENID2_NS, 'claimed_id',
$claimed_id);
}
}
if ($this->assoc) {
$message->setArg(Auth_OpenID_OPENID_NS, 'assoc_handle',
$this->assoc->handle);
}
return $message;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Auth_OpenID_AuthRequest::htmlMarkup (   $realm,
  $return_to = null,
  $immediate = false,
  $form_tag_attrs = null 
)

Get a complete html document that will autosubmit the request to the IDP.

Wraps formMarkup. See the documentation for that function.

Definition at line 1947 of file Consumer.php.

References Auth_OpenID\autoSubmitHTML(), formMarkup(), and Auth_OpenID\isFailure().

{
$form = $this->formMarkup($realm, $return_to, $immediate,
$form_tag_attrs);
if (Auth_OpenID::isFailure($form)) {
return $form;
}
}

+ Here is the call graph for this function:

Auth_OpenID_AuthRequest::redirectURL (   $realm,
  $return_to = null,
  $immediate = false 
)

Definition at line 1908 of file Consumer.php.

References getMessage(), and Auth_OpenID\isFailure().

{
$message = $this->getMessage($realm, $return_to, $immediate);
if (Auth_OpenID::isFailure($message)) {
return $message;
}
return $message->toURL($this->endpoint->server_url);
}

+ Here is the call graph for this function:

Auth_OpenID_AuthRequest::setAnonymous (   $is_anonymous)

Set whether this request should be made anonymously.

If a request is anonymous, the identifier will not be sent in the request. This is only useful if you are making another kind of request with an extension in this request.

Anonymous requests are not allowed when the request is made with OpenID 1.

Definition at line 1805 of file Consumer.php.

{
if ($is_anonymous && $this->message->isOpenID1()) {
return false;
} else {
$this->_anonymous = $is_anonymous;
return true;
}
}
Auth_OpenID_AuthRequest::shouldSendRedirect ( )

Definition at line 1959 of file Consumer.php.

{
return $this->endpoint->compatibilityMode();
}

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