How to restrict access to swagger APIs ?
Follow the below steps to make swagger forbidden from access
- Goto your IIS server
- Click localhost (example- LAPTOP1(domain\username))
- Navigate to URL Rewrite and double click URL Rewrite
- Click Add Rule on right hand side
- Double click Request blocking
- Configure the details in Add request blocking rule page as shown below
- Click OK
- Restart the server
- Now the swagger page is forbidden.