The rights of the several parties, plaintiff as well as defendant, may be put in issue, tried, and determined in such action; and when a sale of the premises is necessary, the title must be ascertained by proof to the satisfaction of the court, before the judgment of sale can be made; and where service of the complaint has been made by publication, like proof must be required of the right of the absent or unknown parties before such judgment is rendered; except that where there are several unknown persons having an interest in the property, their rights may be considered together in the action, as not between themselves.
SDCL 21-45-12