modularized basic auth