diff --git a/changelog/unreleased/fix-tokencache-ttl.md b/changelog/unreleased/fix-tokencache-ttl.md new file mode 100644 index 0000000000..e437234c78 --- /dev/null +++ b/changelog/unreleased/fix-tokencache-ttl.md @@ -0,0 +1,5 @@ +Bugfix: Fix the ttl of the authentication middleware cache + +The authentication cache ttl was multiplied with `time.Second` multiple times. This resulted in a ttl that was not intended. + +https://github.com/owncloud/ocis/pull/1699 diff --git a/proxy/pkg/middleware/authentication.go b/proxy/pkg/middleware/authentication.go index 1c98857275..2e0f0f5dcc 100644 --- a/proxy/pkg/middleware/authentication.go +++ b/proxy/pkg/middleware/authentication.go @@ -5,7 +5,6 @@ import ( "net/http" "regexp" "strings" - "time" ) var ( @@ -114,7 +113,7 @@ func newOIDCAuth(options Options) func(http.Handler) http.Handler { HTTPClient(options.HTTPClient), OIDCIss(options.OIDCIss), TokenCacheSize(options.UserinfoCacheSize), - TokenCacheTTL(time.Second*time.Duration(options.UserinfoCacheTTL)), + TokenCacheTTL(options.UserinfoCacheTTL), CredentialsByUserAgent(options.CredentialsByUserAgent), ) }