0

I have a WebAPI that I am able to debug/deploy in 4 different place with no code changes and it only acts different in production. On the image below, the left shows the local dev machine (both VS & IIS), the right shows the production server, both IIS, one for staging one from prod. It started out as a CORS issue I thought...I could tell headers weren't being sent and received. But as I'm digging in, I can see it starts before that. It's saying that the ClientId is not being sent (AzureAd), although it's obviously working fine on other 3 environment scenarios.

enter image description here

Then I used chrome://net-export/ I found in this question. As I dug in through the results of that, I went all the way to just before stopping the logging, when the error is shown and I can see that the ClientId IS BEING SENT (second image shows cleaned up from the net export file). An Access Token is being sent back as well

enter image description here

Response being returned enter image description here

Both the request and response show up as a socket connection. I don't know enough about that to know if, or what, impact that may have enter image description here

So, I've been struggling on this and am now at a complete loss. The staging and production are same server. This isn't a new production site; it's actually been up for over a year and working fine. It's managed code, running on IIS on Win 12 Server.

Here's the differences: This is after .net core upgrade. Again, works everywhere else, even on same server.

ANY IDEAS at all before I go completely bald????

Briana Finney
  • 1,171
  • 5
  • 12
  • 22

1 Answers1

0

UPDATE: I finally fixed this. In the web.config, I changed the ASPNETCORE_ENVIRONMENT value and it began working immediately.

This is one of those issues that are not too usual, but maybe helpful to someone in the future. The Web.Config never crossed my mind through all of this. This was simply matter of desperation at this point. I swear sometimes just asking the question is the magic. :-)

enter image description here

Briana Finney
  • 1,171
  • 5
  • 12
  • 22