swagger-codegen icon indicating copy to clipboard operation
swagger-codegen copied to clipboard

swagger authentication for spring mvc

Open pranotiB opened this issue 9 years ago • 2 comments

Im using swagger 2.4.0 version in my spring mvc project. All working fine. But now I want to add authentication to my REST web services. I want to show authorize button on swagger ui. Can anybody help me? I saw the posts related to swagger authentication but it was confusing and they are from almost 1-2 years ago. So can anybody help me? Is that issue has been solved in 2.4.0? Do I have to add that authorize button in html page manually?

pranotiB avatar May 05 '17 12:05 pranotiB

Authentication is currently not supported by the spring templates. To add authentication, you can have a look at spring security. I don't think Springfox currently supports spring-security so you will have to configure it manually your Springfox SecurityContext (see example)

cbornet avatar May 05 '17 12:05 cbornet

Yes I did add spring security but that was not supported to springfox. I'll check for springfox security context.. Thanks @cbornet ...

pranotiB avatar May 05 '17 13:05 pranotiB