Back in the days before the psychic paper, this is how the Doctor got into places. Sheer stubbornness.
In this instance, he was going to see the Brigadier at the U.N.I.T reunion in the serial, The Five Doctors. So, for once, the Doctor was not lying about being allowed to go in. Well, not entirely.