Description
I have implemented a REST API using Spring Boot and a running OpenAPI documentation using SpringDoc.
The authentication is done without OAuth, but using Spring Secutiry and JWT/JWS. So, there is the "login"-endpoint automagically provided by Spring.
Using SecurityScheme
, I enabled authentication for SwaggerUI:
new SecurityScheme ().name (securitySchemeName)
.type (SecurityScheme.Type.HTTP)
.scheme ("bearer")
.bearerFormat ("JWT")))
This works fine so far, meaning, as long as the user already has his Base64-encoded JWT at hand, he can use it to login and use SwaggerUI to issue authenticated requests.
But: to do this, he must first issue a login request "out of band", via a curl request for example, to authenticate and retrieve the JWT. is there a way to also have the login endpoint as part of the SwaggerUI automatically (i.e. in a generated way), so that it can also be used by the user to conveniently log in?