In fact, the "papers" or visa, as we know it, has been developped since the 19th century, with the rise of the concept of nations.
During ancient times, you sometimes need an official seal to access a city or a part of a city. People were also often recognize by their clothes or their language.