ch4mpy / spring-addons

Ease spring OAuth2 resource-servers configuration and testing
Apache License 2.0
530 stars 87 forks source link

Support Basic Authentication for specific url (eg. /swagger-ui/**) #99

Closed JayAhn2 closed 1 year ago

JayAhn2 commented 1 year ago

Is your feature request related to a problem? Please describe. I want to add basic authentication to specific urls like /swagger-ui/index.html or /v3/api-docs/**, but I'm not sure whether I can achieve it with this lib now or not. If possible, could you help me how to do it?

Describe the solution you'd like Add basic auth server endpoints which cannot be secured by JWT.

ch4mpy commented 1 year ago
  1. This is an issue tracker and neither a forum nor Stackoverflow
  2. yes, Swagger can be can be secured with OAuth2:
  3. OAuth2 client-credentials flow allows to authenticate a programmatic client with an ID and a secret (just like you intend to do with basic auth
  4. if you want to add basic auth to an endpoint (which makes little sense considering the points above), just create a separate security filterchain for it, just like it is done for the UI in the tutorial linked above
JayAhn2 commented 1 year ago

Sorry! I will post this kind of questions in Stackoverflow.

Thanks for your answer a lot!