Ticket #69 (new defect)

Opened 1 year ago

failure of stored discovery information should indicate a broken message

Reported by: http://keturn.myopenid.com/ Assigned to:
Priority: minor Milestone:
Keywords: logging id_res verify Cc:
Project: python-openid OpenID Protocol: OpenID 2.x
Series: 2.x.x Web Browser:

Description

_verifyDiscoveryResultsOpenID2 has a block like this:

try:
    self._verifyDiscoverySingle(endpoint, to_match)
except ProtocolError, e:
    oidutil.log("Error attempting to use stored discovery information: " +
                str(e))
    oidutil.log("Attempting discovery to verify endpoint")
    endpoint = self._discoverAndVerify(to_match)

This may mask the real cause of the error, as it did in #40.

Possible solutions:

1. Code in more exceptional cases, i.e. do not try _discoveryAndVerify if getAssociation(endpoint).handle == resp_msg.getArg(OPENID2_NS, 'assoc_handle'), because that's an indication we're probably not in stateless mode and we probably have a handle that won't work somewhere else.

2. Leave the code free of more exceptional clutter, but change the error reporting so that if the _discoverAndVerify *also* fails, the previously logged error is included in that exception.

3. Better integrate the web framework with the error logging, so that it shows log messages generated during the request instead of just str(exception).

3b. get django/fastcgi to write log messages anywhere at all. (afaik, they just go in to the bit bucket right now.)