Added support for authentication to external database