define(["connectionManager","loading","skinManager","globalize","appRouter"],function(connectionManager,loading,skinManager,globalize,appRouter){"use strict";return{authenticateUser:function(serverId,username,password){loading.show();var apiClient=connectionManager.getApiClient(serverId);apiClient.authenticateUserByName(username,password).then(function(result){appRouter.handleConnectionResult({State:"SignedIn",ApiClient:apiClient})},function(result){loading.hide(),require(["alert"],function(alert){alert({text:globalize.translate("MessageInvalidUser"),title:globalize.translate("HeaderSignInError")})})})}}});