added basic auth support.