Home | Trees | Indices | Help |
|
---|
|
The first and last of these tasks may performed by the decodeRequest and encodeResponse methods of the Server object. Who gets to do the intermediate task -- deciding how to respond to the request -- will depend on what type of request it is.
If it's a request to authenticate a user (a checkid_setup
or checkid_immediate
request), you need
to decide if you will assert that this user may claim the identity in
question. Exactly how you do that is a matter of application policy,
but it generally involves making sure the user has an account with your
system and is logged in, checking to see if that identity is hers to
claim, and verifying with the user that she does consent to releasing
that information to the party making the request.
Examine the properties of the CheckIDRequest object, and if and when you've come to a decision, form a response by calling CheckIDRequest.answer.
Other types of requests relate to establishing associations between client and server and verifying the authenticity of previous communications. Server contains all the logic and data necessary to respond to such requests; just pass the request to Server.handleRequest.Do you want to provide other information for your users in addition to authentication? Version 2.0 of the OpenID protocol allows consumers to add extensions to their requests. For example, with sites using the Simple Registration Extension, a user can agree to have their nickname and e-mail address sent to a site when they sign up.
Since extensions do not change the way OpenID authentication works, code to handle extension requests may be completely separate from the OpenIDRequest class here. But you'll likely want data sent back by your extension to be signed. OpenIDResponse provides methods with which you can add data to it which can be signed with the other data in the OpenID signature.
For example:# when request is a checkid_* request response = request.answer(True) # this will a signed 'openid.sreg.timezone' parameter to the response # as well as a namespace declaration for the openid.sreg namespace response.fields.setArg('http://openid.net/sreg/1.0', 'timezone', 'America/Los_Angeles')
openid.store.interface.OpenIDStore
.
Additionally, several concrete store implementations are provided, so
that most sites won't need to implement a custom store. For a store
backed by flat files on disk, see openid.store.filestore.FileOpenIDStore
. For
stores based on MySQL or SQLite, see the openid.store.sqlstore
module.
The keys by which a server looks up associations in its store have changed in version 1.2 of this library. If your store has entries created from version 1.0 code, you should empty it.
FIXME: add notes on 1.2 -> 2.0 upgrade here.
|
|||
PlainTextServerSession An object that knows how to handle association requests with no session type. |
|||
DiffieHellmanSHA1ServerSession An object that knows how to handle association requests with the Diffie-Hellman session type. |
|||
DiffieHellmanSHA256ServerSession | |||
WebResponse I am a response to an OpenID request in terms a web server understands. |
|||
Signatory I sign things. |
|||
Encoder I encode responses in to WebResponses. |
|||
SigningEncoder I encode responses in to WebResponses, signing them when required. |
|||
Decoder I decode an incoming web request in to a OpenIDRequest. |
|||
Server I handle requests for an OpenID server. |
|||
ProtocolError A message did not conform to the OpenID protocol. |
|||
VersionError Raised when an operation was attempted that is not compatible with the protocol version being used. |
|||
NoReturnToError Raised when a response to a request cannot be generated because the request contains no return_to URL. |
|||
EncodingError Could not encode this as a protocol message. |
|||
AlreadySigned This response is already signed. |
|||
UntrustedReturnURL A return_to is outside the trust_root. |
|||
MalformedReturnURL The return_to URL doesn't look like a valid URL. |
|||
MalformedTrustRoot The trust root is not well-formed. |
|||
Requests | |||
---|---|---|---|
OpenIDRequest I represent an incoming OpenID request. |
|||
CheckAuthRequest A request to verify the validity of a previous response. |
|||
AssociateRequest A request to establish an association. |
|||
CheckIDRequest A request to confirm the identity of a user. |
|||
Responses | |||
OpenIDResponse I am a response to an OpenID request. |
|
|||
BROWSER_REQUEST_MODES = ['checkid_setup', 'checkid_immediate']
|
|||
UNUSED = None
|
|||
HTTP Codes | |||
---|---|---|---|
HTTP_OK = 200
|
|||
HTTP_REDIRECT = 302
|
|||
HTTP_ERROR = 400
|
|||
Response Encodings | |||
ENCODE_KVFORM = ('kvform',)
|
|||
ENCODE_URL = ('URL/redirect',)
|
|
HTTP_OK
|
HTTP_REDIRECT
|
HTTP_ERROR
|
BROWSER_REQUEST_MODES
|
ENCODE_KVFORM
|
ENCODE_URL
|
UNUSED
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0alpha3 on Fri May 11 15:30:19 2007 | http://epydoc.sourceforge.net |