Description
Describe the bug
We use OAuth2 for authentication of our endpoints. We do not set any server configurations or the oauth2RedirectUrl
explicitly and allow Springdoc to calculate the oauth2RedirectUrl
at runtime when the Swagger UI is loaded. This works the first time, however it has the unexpected side effect of caching this value forever.
Our use case is we have servers which may have both a server name and an IP address (or an FQDN as well). However, whichever method is used to initially access the Swagger UI, that is the oauth2RedirectUrl
which will be used forever.
Currently, the only workaround I have found is to completely disable the cache, which works but is obviously less than ideal.
To Reproduce
- Setup oauth2 auth for an endpoint
- Do not specify the
oauth2RedirectUrl
- Access the Swagger UI using an IP address
- Access the Swagger UI using
localhost
Expected behavior
If the oauth2RedirectUrl
has not been specified as an FQDN and is simply a relative path, then upon each request a new oauth2RedirectUrl
would be calculated using the incoming host name on the request.