Beispiel #1
0
def _render_response(request, openid_response, server=None):
    if not server:
        server = utils.get_server()

    try:
        webresponse = server.encodeResponse(openid_response)
    except EncodingError, why:
        import cgi
        return _render_error(request, cgi.escape(why.response.encodeToKVForm()))
Beispiel #2
0
def endpoint(request):
    from openid.server.server import ProtocolError
    server = utils.get_server()

    data = dict(request.REQUEST.items())

    try:
        openid_request = server.decodeRequest(data)
    except ProtocolError, why:
        return _render_error(request, force_unicode(why))