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

def examples::djopenid::server::views::processTrustResult (   request  ) 

Handle the result of a trust decision and respond to the RP
accordingly.

Definition at line 180 of file views.py.

00180                                :
    """
    Handle the result of a trust decision and respond to the RP
    accordingly.
    """
    # Get the request from the session so we can construct the
    # appropriate response.
    openid_request = getRequest(request)

    result = None
    response_identity = openid_request.identity

    # If the decision was to allow the verification, respond
    # accordingly.
    if 'allow' in request.POST:
        result = True
    elif 'cancel' in request.POST:
        # Otherwise, respond with False.
        result = False

    # If the request was an IDP-driven identifier selection request
    # (i.e., the IDP URL was entered at the RP), look at the form to
    # find out what identity URL the user wanted to send.
    if openid_request.idSelect():
        response_identity = getUserURL(request, name=request.POST['name'])

    # Generate a response with the appropriate answer.
    openid_response = openid_request.answer(result,
                                            identity=response_identity)

    # Send Simple Registration data in the response, if appropriate.
    if result:
        sreg_data = {
            'fullname': 'Example User',
            'nickname': 'example',
            'dob': '1970-01-01',
            'email': 'invalid@example.com',
            'gender': 'F',
            'postcode': '12345',
            'country': 'ES',
            'language': 'eu',
            'timezone': 'America/New_York',
            }

        sreg.sendSRegFields(openid_request, sreg_data,
                            openid_response)

    return displayResponse(request, openid_response)

def displayResponse(request, openid_response):


Generated by  Doxygen 1.6.0   Back to index