public UserInfo GetUserInfo() { var apiInstance = new AuthApi(ServerUrl); var serverEnvironment = GetServerEnvironment(); var userInfo = apiInstance.GetUserInfo(ApiVersion, ServerType, OrganizationName, serverEnvironment, ServerUrl, Username, Password); return(userInfo); }
public UserInfo GetDocumentsAuthToken(string username, string password) { var apiInstance = new AuthApi(ServerUrl); string serverType = "Documents"; var serverEnvironment = GetServerEnvironment(); var userInfo = apiInstance.GetUserInfo(ApiVersion, serverType, OrganizationName, serverEnvironment, ServerUrl, username, password); return(userInfo); }
public UserInfo GetUserInfo() { var apiInstance = new AuthApi(ServerUrl); try { var serverEnvironment = GetServerEnvironment(); var userInfo = apiInstance.GetUserInfo(ApiVersion, ServerType, OrganizationName, serverEnvironment, ServerUrl, Username, Password, AgentId); return(userInfo); } catch (Exception ex) { if (ex.Message != "One or more errors occurred.") { throw new InvalidOperationException("Exception when calling AuthApi.RefreshToken: " + ex.Message); } else { throw new InvalidOperationException(ex.InnerException.Message); } } }