Pull authentication & authorization code out into bodhi.security