I'm using netdeamon to write some automations on home assistant.
I would like to write some files from ha to a share on synology.
on synology i made a user "ha" with the pw "wonttellyou" and gave write access to \\myserver\HomeAssistant (access path used for a windows machine)
var relPath = GetUrl(); // "/myfolder/myfile.log"
using var client = new HttpClient();
var response = await client.GetAsync("http://homeassistant.local:8123" + relPath);
using var fs = File.Create(Path.Combine(@"\\myserver\HomeAssistant", "myfile.log"));
using var s = await response.Content.ReadAsStreamAsync();
await s.CopyToAsync(fs);
This obviously doesn't work because I'm not passing any credentials. Googling didn't bring any satisfying results (solutions that involves calling Win32 api).
Any ideas how to impersonate the user or how to pass the credentials?