In the modern day, obviously, if the president found his way into a camp in the middle east, he's well known enough that if someone was impersonating him, it's a Mystique situation, as opposed to a random guy claiming to be him.
This question actually came from an episode of the West Wing, when President Bartlet gives an order to the Chairman of the Joint Chiefs and the chairman relays they order over the phone using what is presumably a specific code reading to verify his identity.
In medieval Europe, prior to universal recognition of the appearance of the leader, was there a similar way of identifying that the orders were coming from the head honcho? Would every platoon leader know what the king looks like and be able to spot my fakery? Would it depend on my dress, my accent, my comportment? Did I have a code phrase I used when giving orders? Did they have to be written and sealed with wax? Could I conceivably get away with this cockamamie plan?
There is always more to say, but variations on this question have come up here from time to time before, and you might like to review some of those earlier threads while waiting for fresh responses to your query. All of these circle around the core issue of how well senior figures in your society – nobles – would have known the face of their king, but collectively they offer some clear pointers towards an answer. Certainly if you were claiming to command the people in the tent as their "liege" they would almost certainly know you in person, since kingship was peripatetic in this period and lordship was something exercised in person.
u/sunagainstgold covered something close to the topic you are interested in via a couple of typically excellent posts in
and
In Middle Ages how did people verify seal authenticity?
And I addressed the problems that would have accompanied attempts at passing off in this period in...
Did surviving servants steal their dead employers’ identities after the Black Death?
Before modern identification documents and modern communications, identifications was usually done by letters of recommendation. If you wanted to identify yoruself as you in a foreign city, you would have someone in your city write you a letter of recommendation, with their personal seal, which you would bring with you. Someone would know this person and their seal and accept their recommendation that you were who you claimed to be.
As for impersonating a royal during Medieval times, it would be hard and expensive. A royal entering an army camp would do so dressed in expensive high-quality (and often extensively adorned) armour, which your regular mercenary would not have access to. The true King would most likely have at least a small following of personal body guards, often as richly equipped as himself. He would have somone in this group carry the royal banner bearing the coat of arms of the nation and the King himself. A royal herald would often accompany the King to announce orders and decrees and carry out negotiations with the enemy.
Many of those that would accompany the King would be of the highest nobilty - close or distant relatives to the King and the highest nobility of the land. Likewise, the commanders and officers of the military camp would also almost always be of the higher nobility. These people know each other, or at least of each other. They know that Duke A's nephew is the page of the King, that Count B commands the King's personal retinue and so on. They would be cousins, brothers-in-law and so on with these people and would recognise them.
Verifying a written order would be done by a royal seal and the actual order being delivered by some-one you coudl trust, such as a royal herald, a nobleman known to be in the service of the King or just a chain of people verified by each other.
You could get away with your plan, but you would need to have a whole party of people that could all impersonate higher nobility, and the cost would be prohibitive - you'll need the armour, weapons, horses and fineries of many of the richest people of the land. And due to the close personal relations between the King and the higher nobility, you will sooner or later encounter someone who knows someone that should be in your party, or has met the King personally, and then the game will be up.