Daemon-Console: No connection could be made because the target machine actively refused it!
This issue is for a: (mark with an x)
- [ ] bug report -> please search issues before submitting
- [ ] feature request
- [X] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)
Minimal steps to reproduce
Any log messages given by the failure
: No connection could be made because the target machine actively refused it. (localhost:44372)' on Daemon-Console\Program.cs line : 28
Expected/desired behavior
OS and Version?
Windows 11.
Versions
11 pro 64 bit
Mention any other details that might be useful
I disabled firewall but even that the issue persist and this is app.setting for console app :
Thanks
@mitnick2012 Assuming this is the chapter where the daemon calls your own web API?
Did you run both the web API and the daemon app? https://github.com/Azure-Samples/active-directory-dotnetcore-daemon-v2/tree/master/2-Call-OwnApi#step-4-run-the-sample
Yes I run it now and I get 401 unauthorized message
Great. Now you want to enable logging in the web API and you'll see why. See https://github.com/AzureAD/microsoft-identity-web/wiki/Logging
good I added logging section on appsettings.json, and the following code on api startup class : services.AddLogging(configure => configure.AddConsole()) .Configure<LoggerFilterOptions>(options => options.MinLevel = Microsoft.Extensions.Logging.LogLevel.Debug);
but I can't find any logger file on my application bin path
this is the detailed error Im facing : Unhandled exception. System.Net.Http.HttpRequestException: 401 Unauthorized at Microsoft.Identity.Web.DownstreamApi.DeserializeOutput[TOutput](HttpResponseMessage response, DownstreamApiOptions effectiveOptions) at Microsoft.Identity.Web.DownstreamApi.GetForAppAsync[TOutput](String serviceName, Action`1 downstreamApiOptionsOverride, CancellationToken cancellationToken)
please any one can help with this issue ?!
Hi @mitnick2012,
I found this issue today (yup, many months later), I was able to fix it updating the API Manifest
Manifest Update
Set the accessTokenAcceptedVersion value from null to 2