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

Security Definitions- SwaggerUI #1108

Closed
rajeshakt opened this issue Apr 1, 2015 · 74 comments
Closed

Security Definitions- SwaggerUI #1108

rajeshakt opened this issue Apr 1, 2015 · 74 comments

Comments

@rajeshakt
Copy link

Hi Team,

Iam unable to load the security definitions through swagger UI documentations.

Please let me know if i need to include any js file/ div classes.

Thanks,
Rajesh

@webron
Copy link
Contributor

webron commented Apr 1, 2015

Not sure what you mean by that. What are you trying to do exactly, what do you expect to see and what do you actually see?

@rajeshakt
Copy link
Author

Please find the attached screenshot for reference. Unable to find these when i explored through swagger UI.

ss2

@webron
Copy link
Contributor

webron commented Apr 1, 2015

That's because swagger-ui doesn't represent the security definitions that way, and is not intended to.

@rajeshakt
Copy link
Author

what needs to be done to represent security definitions in SwaggerUI ?
Do we need to incorporate any .js.

@webron
Copy link
Contributor

webron commented Apr 1, 2015

Currently, there's no way to display that.

@rajeshakt
Copy link
Author

we needed that urgently for documentation. Any help will be appreciated !

@mohsen1
Copy link
Contributor

mohsen1 commented Apr 1, 2015

Basic auth is simply a header. SwaggerUI has an API for adding auth headers. See here to learn about the API and here to learn about HTTP basic auth.

You can make a form somewhere in the UI to process username/passwords and set the auth header if you want

@rajeshakt
Copy link
Author

My question is when the swagger editor can display, why swagger UI is not doing ?

This needs to be fixed, else how can we share the security information with the consumers?

What I feel is whatever the features are there in swaggereditor should be same in swaggerUI, whereas the later one is restricted to only for documentation/view.

Thanks,

@webron
Copy link
Contributor

webron commented Apr 2, 2015

The editor and ui are two completely separate projects (for now). The UI does not show the security information right now, and there's no 'add-on' to add the display (though you can probably write one on your own). Basic authentication and OAuth2 can be easily integrated into the UI with no special display of the security specifically.

@shuisman
Copy link
Contributor

shuisman commented Apr 7, 2015

+1
It would be very nice to include the security information in the swagger UI project. This information is very helpful when exploring the API.

@wesselkranenborg
Copy link

+1

2 similar comments
@ximex
Copy link

ximex commented Jun 16, 2015

👍

@Bazman
Copy link

Bazman commented Jun 26, 2015

+1

@ponelat
Copy link
Member

ponelat commented Jun 29, 2015

I agree, most useful to know.
It would be nice if we didn't need to go into the index.html file to add authentication AND to be able to view it of course 😄 ... anyone keen on creating a PR?

@anirban1c
Copy link

+1 I am hard coding the auth headers at the moment, would love to have this in

@palamccc
Copy link

+1 😃

@alexvodovoz
Copy link

+1

@webron webron removed the P3 label Jul 21, 2015
@fela98
Copy link

fela98 commented Jul 22, 2015

+1

@webron webron modified the milestones: v2.1.1, v2.1.2 Jul 31, 2015
@fehguy
Copy link
Contributor

fehguy commented Mar 5, 2016

See pull #2014 and please give feedback on that. There are a couple todos left

@ximex
Copy link

ximex commented Mar 15, 2016

#2014 is merged

@ichpuchtli
Copy link

+1

4 similar comments
@pawelprazak
Copy link

+1

@J4S0Nc
Copy link

J4S0Nc commented Jun 1, 2016

+1

@my-flow
Copy link

my-flow commented Jun 7, 2016

+1

@sulliwane
Copy link

+1

@mmeylan
Copy link

mmeylan commented Jun 25, 2016

+ 1

@ax003d
Copy link

ax003d commented Jul 13, 2016

+1

1 similar comment
@merritts
Copy link

+1

@fehguy
Copy link
Contributor

fehguy commented Jul 25, 2016

This is in the 2.1.5 release.

@fehguy fehguy closed this as completed Jul 25, 2016
@neilyoung
Copy link

When will it be released?

@webron
Copy link
Contributor

webron commented Aug 2, 2016

8 days ago.

@mnapoli
Copy link

mnapoli commented Aug 25, 2016

With the latest release I cannot see anything different (with a Basic Auth documented), where is it supposed to display? Do you have any screenshot or link to the pull request?

@doooks
Copy link

doooks commented Nov 14, 2016

I don't understand why displaying the security information for an API is out of scope.

http://swagger.io/swagger-ui/ says that Swagger UI is to "dynamically generate beautiful documentation" - why would the API's security mechanism be excluded from the visible documentation? You need that information to write an API client, you might not be using the auto-generated code.

Does anyone have a fork or a PR that renders the security infomation? Otherwise, if I work on a PR would someone on the project team consider that feature?

@webron
Copy link
Contributor

webron commented Nov 14, 2016

@doooks - in general, we love getting PRs that push the project forward, but right now we're focused on a major update to the project and it's probably not the best time to submit such a PR specifically.

@bcfreitas
Copy link

+1

@vladkras
Copy link

+1
I had to move apikey to one of required parameters because of this

@iongion
Copy link

iongion commented Jan 20, 2017

@vladkras amen!

@leonluocheng
Copy link

leonluocheng commented May 23, 2017

+1
I would like to see we have security feature integrated with the swagger UI.
The work around I can do is to add an "authorization" parameter

@webron
Copy link
Contributor

webron commented May 23, 2017

@leonluocheng hmm? the security definitions are displayed in the current version.

@leonluocheng
Copy link

@webron I am using swashbuckle.core 5.5.3, maybe that causes this issue. but the swagger generated UI did not display the basic authentication that I specified in app configuration.

Example:
c.BasicAuth("basic").Description("Basic HTTP Authentication over TLS");

image

@webron
Copy link
Contributor

webron commented May 25, 2017

That's a very old version of the UI. Use the latest one and you should be good.

@Pratyushm91
Copy link

Hi,

I went through the complete thread. I also require to display the basic auth security field for setting client id and secret. And with the new swagger it looks really cool. Kindly let me know if any module available which can render my json file to similar swagger ui format. I already used swagger ui formatter but it is not displaying me the security field.

Thanks.

@dFarkhod
Copy link

dFarkhod commented Oct 11, 2021

+1

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

No branches or pull requests