cancel
Showing results for 
Search instead for 
Did you mean: 

Swagger with on-prem deployment

SOLVED
Highlighted
New Contributor

Swagger with on-prem deployment

Our application is Microsoft stack. We deploy our application in the client environment. We want to turn off the swagger when deploying on the clients infrastructure. If we keep config change in the app.config or database, the end client can easily turn on the swagger and view all our private apis. They also have admin access to the DB. Is there a secured way of turning off the swagger for the on-prem deployment?

1 ACCEPTED SOLUTION

Accepted Solutions
Moderator

Re: Swagger with on-prem deployment

Thanks for the information. So you're getting Swagger UI installed as part of nswag. Unfortunately, nswag is not one of our projects so I'm not familiar with its configuration options and whether they offer a way to disable expsosing things through configuration.

 

Your best bet is to go through the documentaiton of nswag (https://github.com/RSuter/NSwag), and if no information is available, file a ticket with them for further support.

6 REPLIES 6
Moderator

Re: Swagger with on-prem deployment

Which Swagger tool are you referring to?

New Contributor

Re: Swagger with on-prem deployment

Swagger UI for API documentation

Moderator

Re: Swagger with on-prem deployment

In that case, either don't deploy Swagger UI as part of your overall deployment, or if it's embedded in your code, configure it such it is is not hosted. The way to do that would vary depending on the framework you use, but eventually, Swagger UI is a collection of HTML/CSS/JS files that are statically exposed.

New Contributor

Re: Swagger with on-prem deployment

Hi Ron,

 

Thank you.  The way we set it up is,

 

1. Installed nswag nuget on web api project
2. Added configuration in Startup.cs
3. Navigate to /swagger endpoint

Moderator

Re: Swagger with on-prem deployment

Thanks for the information. So you're getting Swagger UI installed as part of nswag. Unfortunately, nswag is not one of our projects so I'm not familiar with its configuration options and whether they offer a way to disable expsosing things through configuration.

 

Your best bet is to go through the documentaiton of nswag (https://github.com/RSuter/NSwag), and if no information is available, file a ticket with them for further support.

New Contributor

Re: Swagger with on-prem deployment

Thank you so much Ron for your help.  Really appreciate it.

New Here?
Join us and watch the welcome video:
Watch the new Interview
Top Kudoed Authors