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

Class ProtocolError

source code

exceptions.Exception --+
                       |
                      ProtocolError
Known Subclasses:
MalformedReturnURL, MalformedTrustRoot, UntrustedReturnURL

A message did not conform to the OpenID protocol.

Instance Methods [hide private]
  __init__(self, query, text=None)
When an error occurs.
bool hasReturnTo(self)
Did this request have a return_to parameter?
str encodeToURL(self)
Encode a response as a URL for the user agent to GET.
str encodeToKVForm(self)
Encode a response in key-value colon/newline format.
  whichEncoding(self)
How should I be encoded?

Inherited from exceptions.Exception: __getitem__, __str__


Instance Variables [hide private]
dict query
The query that is failing to be a valid OpenID request.

Method Details [hide private]

__init__(self, query, text=None)
(Constructor)

source code 

When an error occurs.
Parameters:
  • query (dict) - The query that is failing to be a valid OpenID request.
  • text (str) - A message about the encountered error. Set as args[0].
Overrides: exceptions.Exception.__init__

hasReturnTo(self)

source code 

Did this request have a return_to parameter?
Returns: bool

encodeToURL(self)

source code 

Encode a response as a URL for the user agent to GET.

You will generally use this URL with a HTTP redirect.
Returns: str
A URL to direct the user agent back to.

encodeToKVForm(self)

source code 

Encode a response in key-value colon/newline format.

This is a machine-readable format used to respond to messages which came directly from the consumer and not through the user agent.
Returns: str

See Also: OpenID Specs, Key-Value Colon/Newline format

whichEncoding(self)

source code 

How should I be encoded?
Returns:
one of ENCODE_URL, ENCODE_KVFORM, or None. If None, I cannot be encoded as a protocol message and should be displayed to the user.

Instance Variable Details [hide private]

query


The query that is failing to be a valid OpenID request.
Type:
dict