You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
jjathman
changed the title
oauth2RedirectUrl calculated in unexpected ways
oauth2RedirectUrl cached unexpectedly
Mar 16, 2022
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 theoauth2RedirectUrl
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
oauth2RedirectUrl
localhost
Expected behavior
If the
oauth2RedirectUrl
has not been specified as an FQDN and is simply a relative path, then upon each request a newoauth2RedirectUrl
would be calculated using the incoming host name on the request.The text was updated successfully, but these errors were encountered: