Logo Search packages:      
Sourcecode: python-openid version File versions

openid::server::server::Server Class Reference

List of all members.


Detailed Description

I handle requests for an OpenID server.

Some types of requests (those which are not C{checkid} requests) may be
handed to my L{handleRequest} method, and I will take care of it and
return a response.

For your convenience, I also provide an interface to L{Decoder.decode}
and L{SigningEncoder.encode} through my methods L{decodeRequest} and
L{encodeResponse}.

All my state is encapsulated in an
L{OpenIDStore<openid.store.interface.OpenIDStore>}, which means
I'm not generally pickleable but I am easy to reconstruct.

Example::

    oserver = Server(FileOpenIDStore(data_path), "http://example.com/op")
    request = oserver.decodeRequest(query)
    if request.mode in ['checkid_immediate', 'checkid_setup']:
        if self.isAuthorized(request.identity, request.trust_root):
            response = request.answer(True)
        elif request.immediate:
            response = request.answer(False)
        else:
            self.showDecidePage(request)
            return
    else:
        response = oserver.handleRequest(request)

    webresponse = oserver.encode(response)

@ivar signatory: I'm using this for associate requests and to sign things.
@type signatory: L{Signatory}

@ivar decoder: I'm using this to decode things.
@type decoder: L{Decoder}

@ivar encoder: I'm using this to encode things.
@type encoder: L{Encoder}

@ivar op_endpoint: My URL.
@type op_endpoint: str

@ivar negotiator: I use this to determine which kinds of
    associations I can make and how.
@type negotiator: L{openid.association.SessionNegotiator}

Definition at line 1311 of file server.py.


Public Member Functions

def __init__
def decodeRequest
def encodeResponse
def handleRequest
def openid_associate
def openid_check_authentication

Public Attributes

 decoder
 encoder
 negotiator
 op_endpoint
 signatory
 store

Static Public Attributes

 decoderClass = Decoder
 encoderClass = SigningEncoder
 signatoryClass = Signatory

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

Generated by  Doxygen 1.6.0   Back to index