Package openid :: Package server :: Module server :: Class CheckIDRequest
[frames | no frames]

Type CheckIDRequest

   object --+    
            |    
OpenIDRequest --+
                |
               CheckIDRequest


A request to confirm the identity of a user.

This class handles requests for openid modes checkid_immediate and checkid_setup.
Method Summary
  __init__(self, identity, return_to, trust_root, immediate, assoc_handle)
Construct me.
  __str__(self)
OpenIDResponse answer(self, allow, server_url)
Respond to this request.
str encodeToURL(self, server_url)
Encode this request as a URL to GET.
CheckIDRequest fromQuery(klass, query)
Construct me from a web query. (Class method)
str getCancelURL(self)
Get the URL to cancel this request.
bool trustRootValid(self)
Is my return_to under my trust_root?
Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__

Instance Variable Summary
str assoc_handle: Provided in smart mode requests, a handle for a previously established association.
str identity: The identity URL being checked.
bool immediate: Is this an immediate-mode request?
str return_to: The URL to send the user agent back to to reply to this request.
str trust_root: "Are you Frank?" asks the checkid request.

Class Variable Summary
str mode: "checkid_immediate" or "checkid_setup"

Instance Method Details

__init__(self, identity, return_to, trust_root=None, immediate=False, assoc_handle=None)
(Constructor)

Construct me.

These parameters are assigned directly as class attributes, see my class documentation for their descriptions.
Raises:
MalformedReturnURL - When the return_to URL is not a URL.
Overrides:
__builtin__.object.__init__

answer(self, allow, server_url=None)

Respond to this request.
Parameters:
allow - Allow this user to claim this identity, and allow the consumer to have this information?
           (type=bool)
server_url -

When an immediate mode request does not succeed, it gets back a URL where the request may be carried out in a not-so-immediate fashion. Pass my URL in here (the fully qualified address of this server's endpoint, i.e. http://example.com/server), and I will use it as a base for the URL for a new request.

Optional for requests where CheckIDRequest.immediate is False or allow is True.
           (type=str)
Returns:
OpenIDResponse

encodeToURL(self, server_url)

Encode this request as a URL to GET.
Parameters:
server_url - The URL of the OpenID server to make this request of.
           (type=str)
Returns:
str

getCancelURL(self)

Get the URL to cancel this request.

Useful for creating a "Cancel" button on a web form so that operation can be carried out directly without another trip through the server.

(Except you probably want to make another trip through the server so that it knows that the user did make a decision. Or you could simulate this method by doing .answer(False).encodeToURL())
Returns:
The return_to URL with openid.mode = cancel.
           (type=str)

trustRootValid(self)

Is my return_to under my trust_root?
Returns:
bool

Class Method Details

fromQuery(klass, query)

Construct me from a web query.
Parameters:
query - The query parameters as a dictionary with each key mapping to one value.
           (type=dict)
Returns:
CheckIDRequest
Raises:
ProtocolError - When not all required parameters are present in the query.
MalformedReturnURL - When the return_to URL is not a URL.
UntrustedReturnURL - When the return_to URL is outside the trust_root.

Instance Variable Details

assoc_handle

Provided in smart mode requests, a handle for a previously established association. None for dumb mode requests.
Type:
str

identity

The identity URL being checked.
Type:
str

immediate

Is this an immediate-mode request?
Type:
bool

return_to

The URL to send the user agent back to to reply to this request.
Type:
str

trust_root

"Are you Frank?" asks the checkid request. "Who wants to know?" trust_root, that's who. This URL identifies the party making the request, and the user will use that to make her decision about what answer she trusts them to have.
Type:
str

Class Variable Details

mode

"checkid_immediate" or "checkid_setup"
Type:
str

Generated by Epydoc 2.1 on Fri Dec 14 11:14:09 2007 http://epydoc.sf.net