Öffentliche Methoden | |
Auth_OpenID_AuthRequest (&$endpoint, $assoc) | |
addExtension (&$extension_request) | |
addExtensionArg ($namespace, $key, $value) | |
setAnonymous ($is_anonymous) | |
getMessage ($realm, $return_to=null, $immediate=false) | |
redirectURL ($realm, $return_to=null, $immediate=false) | |
formMarkup ($realm, $return_to=null, $immediate=false, $form_tag_attrs=null) | |
htmlMarkup ($realm, $return_to=null, $immediate=false, $form_tag_attrs=null) | |
shouldSendRedirect () |
Definiert in Zeile 1741 der Datei Consumer.php.
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.
Definiert in Zeile 1767 der Datei Consumer.php.
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.
string | $namespace The namespace for the extension. For example, the simple registration extension uses the namespace 'sreg'. | |
string | $key The key within the extension namespace. For example, the nickname field in the simple registration extension's key is 'nickname'. | |
string | $value The value to provide to the server for this argument. |
Definiert in Zeile 1791 der Datei Consumer.php.
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.
Definiert in Zeile 1751 der Datei Consumer.php.
01752 { 01753 $this->assoc = $assoc; 01754 $this->endpoint =& $endpoint; 01755 $this->return_to_args = array(); 01756 $this->message = new Auth_OpenID_Message( 01757 $endpoint->preferredNamespace()); 01758 $this->_anonymous = false; 01759 }
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.
Definiert in Zeile 1928 der Datei Consumer.php.
01930 { 01931 $message = $this->getMessage($realm, $return_to, $immediate); 01932 01933 if (Auth_OpenID::isFailure($message)) { 01934 return $message; 01935 } 01936 01937 return $message->toFormMarkup($this->endpoint->server_url, 01938 $form_tag_attrs); 01939 }
getMessage | ( | $ | realm, | |
$ | return_to = null , |
|||
$ | immediate = false | |||
) |
Produce a Auth_OpenID_Message representing this request.
string | $realm The URL (or URL pattern) that identifies your web site to the user when she is authorizing it. | |
string | $return_to The URL that the OpenID provider will send the user back to after attempting to verify her identity. |
bool | $immediate If 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. |
Definiert in Zeile 1835 der Datei Consumer.php.
01836 { 01837 if ($return_to) { 01838 $return_to = Auth_OpenID::appendArgs($return_to, 01839 $this->return_to_args); 01840 } else if ($immediate) { 01841 // raise ValueError( 01842 // '"return_to" is mandatory when 01843 //using "checkid_immediate"') 01844 return new Auth_OpenID_FailureResponse(null, 01845 "'return_to' is mandatory when using checkid_immediate"); 01846 } else if ($this->message->isOpenID1()) { 01847 // raise ValueError('"return_to" is 01848 // mandatory for OpenID 1 requests') 01849 return new Auth_OpenID_FailureResponse(null, 01850 "'return_to' is mandatory for OpenID 1 requests"); 01851 } else if ($this->return_to_args) { 01852 // raise ValueError('extra "return_to" arguments 01853 // were specified, but no return_to was specified') 01854 return new Auth_OpenID_FailureResponse(null, 01855 "extra 'return_to' arguments where specified, " . 01856 "but no return_to was specified"); 01857 } 01858 01859 if ($immediate) { 01860 $mode = 'checkid_immediate'; 01861 } else { 01862 $mode = 'checkid_setup'; 01863 } 01864 01865 $message = $this->message->copy(); 01866 if ($message->isOpenID1()) { 01867 $realm_key = 'trust_root'; 01868 } else { 01869 $realm_key = 'realm'; 01870 } 01871 01872 $message->updateArgs(Auth_OpenID_OPENID_NS, 01873 array( 01874 $realm_key => $realm, 01875 'mode' => $mode, 01876 'return_to' => $return_to)); 01877 01878 if (!$this->_anonymous) { 01879 if ($this->endpoint->isOPIdentifier()) { 01880 // This will never happen when we're in compatibility 01881 // mode, as long as isOPIdentifier() returns False 01882 // whenever preferredNamespace() returns OPENID1_NS. 01883 $claimed_id = $request_identity = 01884 Auth_OpenID_IDENTIFIER_SELECT; 01885 } else { 01886 $request_identity = $this->endpoint->getLocalID(); 01887 $claimed_id = $this->endpoint->claimed_id; 01888 } 01889 01890 // This is true for both OpenID 1 and 2 01891 $message->setArg(Auth_OpenID_OPENID_NS, 'identity', 01892 $request_identity); 01893 01894 if ($message->isOpenID2()) { 01895 $message->setArg(Auth_OpenID_OPENID2_NS, 'claimed_id', 01896 $claimed_id); 01897 } 01898 } 01899 01900 if ($this->assoc) { 01901 $message->setArg(Auth_OpenID_OPENID_NS, 'assoc_handle', 01902 $this->assoc->handle); 01903 } 01904 01905 return $message; 01906 }
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.
Definiert in Zeile 1947 der Datei Consumer.php.
01949 { 01950 $form = $this->formMarkup($realm, $return_to, $immediate, 01951 $form_tag_attrs); 01952 01953 if (Auth_OpenID::isFailure($form)) { 01954 return $form; 01955 } 01956 return Auth_OpenID::autoSubmitHTML($form); 01957 }
redirectURL | ( | $ | realm, | |
$ | return_to = null , |
|||
$ | immediate = false | |||
) |
Definiert in Zeile 1908 der Datei Consumer.php.
01910 { 01911 $message = $this->getMessage($realm, $return_to, $immediate); 01912 01913 if (Auth_OpenID::isFailure($message)) { 01914 return $message; 01915 } 01916 01917 return $message->toURL($this->endpoint->server_url); 01918 }
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.
Definiert in Zeile 1805 der Datei Consumer.php.
01806 { 01807 if ($is_anonymous && $this->message->isOpenID1()) { 01808 return false; 01809 } else { 01810 $this->_anonymous = $is_anonymous; 01811 return true; 01812 } 01813 }
shouldSendRedirect | ( | ) |
Copyright © 2003 - 2009 MyOOS [Shopsystem]. All rights reserved. MyOOS [Shopsystem] is Free Software released under the GNU/GPL License. Webmaster: info@r23.de (Impressum) |
|