def self.from_message(message, op_endpoint=UNUSED)
assoc_handle = message.get_arg(OPENID_NS, 'assoc_handle')
invalidate_handle = message.get_arg(OPENID_NS, 'invalidate_handle')
signed = message.copy()
if signed.has_key?(OPENID_NS, "mode")
signed.set_arg(OPENID_NS, "mode", "id_res")
end
obj = self.new(assoc_handle, signed, invalidate_handle)
obj.message = message
obj.sig = message.get_arg(OPENID_NS, 'sig')
if !obj.assoc_handle or
!obj.sig
msg = sprintf("%s request missing required parameter from message %s",
obj.mode, message)
raise ProtocolError.new(message, msg)
end
return obj
end