Azure Functions Middleware - Part 4 - Quick Check

This is Part 4 in series and probably the last part related to Middleware. From Part 1 to Part 3 I have shared implementation detail and explain few things around that.

Now how you can quickly check that part. Probably any tool can be used to test REST API. Most popular one this is Postman and recently REST Client with VS Code also making buzz. I am going to use REST Client but I am no way directly associated with it.

image.png

Simple call without bearer token. image.png

Click on send request. It get following response. (Status code : 401) image.png

Simple call with bearer token with invalid role. image.png

Click on send request. It get following response. (Status code : 403) image.png

Simple call with bearer token with admin role token. image.png

Click on send request. It get following response. (Status code : 200) image.png

Hope it helps.