A few years back, we had people posing as city workers or Utility workers gaining access to people homes to rob them. I don't think they ever caught them. I would say trust your instincts on this and be suspicious of everyone that you don't know.
Even if the Police at your door are bonafide, there is little reason to ever invite them into your home. Yu have to remember that even if there is a nice guy inside the uniform, he is generally bound to the statutes and his job is to spot infractions and use them against you in a court of law. You don't have to resist the police, but you don't have to invite them in. Conduct your business on the porch with the door closed and politely decline them when they ask real nice if they can step inside...
If you don't let anyone in as a rule, how could you be invaded?
"Always place your clothes and weapons where you can find them in the dark"
"Understand that the enemy is not the enemy in his own eyes ;this may offer you an opportunity to make him your friend. If not, you can kill him without hate, and quickly."