Legal Declaration concerning Tribal Affiliation
Maimonides. Laws of Kings and their Wars, 12:
3 During the era of the Messianic king, once his kingdom has been established and all of Israel has gathered around him, the Israelite family lineage will be given by his mouth through the holy spirit that will rest upon him, as Malachi 3:3 states: "He shall sit as a refiner and purifier."
He will purify the lineage of the Levites first, stating "He is a priest (Cohen) of defined lineage. He is a Levite of defined lineage." Those [of the cohanim-priests] whose lineage he will not recognize will be lowered to the status of Israelites. This is stated in Ezra 2:63: "The governor said to them: 'They should not eat of the most holy things until a priest arises who will wear the Urim vi-Tumim.'" From this verse, you can infer that the prophetic spirit will be used to define and notify the pedigree of lineage.
When he defines the lineage of the Israelites, he will make known their tribal lineage alone, stating: "He is from this tribe and he is from another tribe." He will not, by contrast, state concerning a person who is presumed to be of unblemished lineage: "He is illegitimate or he is of slave lineage." For the law is once a family has become assimilated, remains assimilated.