Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

what's this line do exactly regarding basic authen in swaggerconfig file? #326

Closed
MarwaAhmed opened this issue May 13, 2015 · 1 comment
Closed

Comments

@MarwaAhmed
Copy link

@ swaggerconfig.cs:

  GlobalConfiguration.Configuration.EnableSwagger( c =>c.BasicAuth("basic")
    .Description("Basic HTTP Authentication");
  • when i uncommented this line i didn't see http basic authn dialog before clicking "try it out"?
  • what shall i do in order to make it work?
    thanks

*linked to #319

@domaindrivendev
Copy link
Owner

This setting merely adds the "basic auth" security definition to the generated Swagger JSON. As far as I know the current swagger-ui does not do anything additional with this information - although I believe full UI support may be in the pipeline - swagger-api/swagger-ui#764.

For now, you can add a simple customization to your swagger-ui "index.html" as described here - swagger-api/swagger-ui#1171. I just tried it out and verified it works.

For this type of customization, you'll need to inject your own version of "index.html" instead of the version embedded in Swashbuckle (see readme https://github.com/domaindrivendev/Swashbuckle#provide-your-own-index-file).

Finally, it's worth bearing in mind that first and foremost, Swashbuckle is a Swagger JSON generator. It does include an embedded swagger-ui for convenience and I'll endeavor to keep this up-to-date so SB users can avail of the latest UI enhancements. Other than that however, I would suggest checking out that repo for UI issues and upcoming features.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants