Added basic auth functions.