active-directory-dotnetcore-daemon-v2 icon indicating copy to clipboard operation
active-directory-dotnetcore-daemon-v2 copied to clipboard

Daemon-Console: No connection could be made because the target machine actively refused it!

Open mitnick2012 opened this issue 2 years ago • 7 comments

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 :

apiissue

Thanks

mitnick2012 avatar Jun 27 '23 20:06 mitnick2012

@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

jmprieur avatar Jun 27 '23 21:06 jmprieur

Yes I run it now and I get 401 unauthorized message

mitnick2012 avatar Jun 27 '23 21:06 mitnick2012

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

jmprieur avatar Jun 27 '23 22:06 jmprieur

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

mitnick2012 avatar Jun 30 '23 20:06 mitnick2012

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)

mitnick2012 avatar Jul 01 '23 11:07 mitnick2012

please any one can help with this issue ?!

mitnick2012 avatar Jul 05 '23 20:07 mitnick2012

Hi @mitnick2012,

I found this issue today (yup, many months later), I was able to fix it updating the API Manifest

image

Manifest Update

Set the accessTokenAcceptedVersion value from null to 2

image

abarberenaCPDS avatar May 01 '24 14:05 abarberenaCPDS