ASP .Net 8 Web API secured with JWT in TestContainer #1290
IDontCareU
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I have setup an ASP .Net 8 Web API in the test container for integration tests. The API is otherwise hosted on IIS in production and has the endpoints secured with JWT. It all works well in production that way.
For the integration tests, I find that the JWT token passed to the endpoint comes back with 500 UNAUTHORIZED.
The error is WWW-Authenticate: Bearer error="invalid_token", error_description="The audience 'api://XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX' is invalid"
Is it because there is no support to reach out to the Azure AD from within the container? Any suggestions on how to get around this please?
Thanks and regards,
Keshav
Beta Was this translation helpful? Give feedback.
All reactions