How do I mock the response from my authentication server for client integration tests?

I have created a microservice using .Net 5 which uses jwt bearer tokens to authenticate clients using an authentication server. The integration tests I have already created now all fail because they return Unauthorized as expected. I can easily add an Authorization header with a token to the request but how do I mock the authorization server’s response to authorize the passed token?

submitted by /u/henk135
[link] [comments]

from Software Development – methodologies, techniques, and tools. Covering Agile, RUP, Waterfall + more! https://ift.tt/3k81U1P

Leave a comment

Design a site like this with WordPress.com
Get started
search previous next tag category expand menu location phone mail time cart zoom edit close