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!(upload://fPeG94Vcpj5GtUAm89z5an4uNXo.html)
- Double click Request blocking
- Configure the details in Add request blocking rule page as shown below!(upload://qzl4VsVzQ9DXxcARMEZh3GjDY0z.html)
- Click OK
- Restart the server
- Now the swagger page is forbidden.