added basic auth support