I have an existing .NET web application and I’ve decided to experiment a bit by adding .NET Aspire to it. I was able to get it up and running, but I’m having trouble with the JWT authorization which worked fine before adding Aspire. Here’s what is currently happening:
The endpoints for Aspire are the default ones (“localhost:17080;localhost:15034”) and I am able to access the dashboard:
enter image description here
I am also able to access the Swagger page of my API and issue the following request:
enter image description here
However, when I debug the auth logic I get the following:
enter image description here
This is the final response as seen in Swagger:
enter image description here
I assume the problem is coming from an internal redirect from the Aspire host to my API, which cuts out the Authorization header. The reason for my assumption is that the request URL root from my Swagger page “localhost:5085” is different from the one I see when I debug “localhost:7196”. I’ve highlighted these observations in the above images.
I tried searching for information both here and in the GitHub repository for Aspire, but failed to find anything relevant. Not much more I can do since I have no idea how to manipulate traffic between the Aspire host and my API app.