verify_discovery_results_openid1 (OpenID::Consumer::IdResHandler)

    # File lib/openid/consumer/idres.rb, line 367
          def verify_discovery_results_openid1
            claimed_id =
              @message.get_arg(BARE_NS, Consumer.openid1_return_to_claimed_id_name)

            if claimed_id.nil?
              if @endpoint.nil?
                raise ProtocolError, ("When using OpenID 1, the claimed ID must "\
                                      "be supplied, either by passing it through "\
                                      "as a return_to parameter or by using a "\
                                      "session, and supplied to the IdResHandler "\
                                      "when it is constructed.")
              else
                claimed_id = @endpoint.claimed_id
              end
            end

            to_match = OpenIDServiceEndpoint.new
            to_match.type_uris = [OPENID_1_1_TYPE]
            to_match.local_id = fetch('identity')
            # Restore delegate information from the initiation phase
            to_match.claimed_id = claimed_id

            to_match_1_0 = to_match.dup
            to_match_1_0.type_uris = [OPENID_1_0_TYPE]

            if !@endpoint.nil?
              begin
                begin
                  verify_discovery_single(@endpoint, to_match)
                rescue TypeURIMismatch
                  verify_discovery_single(@endpoint, to_match_1_0)
                end
              rescue ProtocolError => why
                Util.log('Error attempting to use stored discovery information: ' +
                         why.message)
                Util.log('Attempting discovery to verify endpoint')
              else
                return @endpoint
              end
            end

            # Either no endpoint was supplied or OpenID 1.x verification
            # of the information that's in the message failed on that
            # endpoint.
            discover_and_verify(to_match.claimed_id, [to_match, to_match_1_0])
          end