Authenticating with multiple databases