From d640719b7a58877b9d55b827331df34982e47913 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Duffeck?= Date: Mon, 3 Apr 2023 14:00:11 +0200 Subject: [PATCH 1/2] Fix oidc auth cache --- services/proxy/pkg/middleware/oidc_auth.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/proxy/pkg/middleware/oidc_auth.go b/services/proxy/pkg/middleware/oidc_auth.go index 7a4f8caa3..9ba727b22 100644 --- a/services/proxy/pkg/middleware/oidc_auth.go +++ b/services/proxy/pkg/middleware/oidc_auth.go @@ -80,7 +80,7 @@ func (m *OIDCAuthenticator) getClaims(token string, req *http.Request) (map[stri if err != nil && err != store.ErrNotFound { m.Logger.Error().Err(err).Msg("could not read from userinfo cache") } - if len(record) > 1 { + if len(record) > 0 { if err = msgpack.Unmarshal(record[0].Value, &claims); err == nil { m.Logger.Debug().Interface("claims", claims).Msg("cache hit for userinfo") return claims, nil From 08dc9b7972a8ae5c187f84a0d8da7f48ea3e711b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Duffeck?= Date: Mon, 3 Apr 2023 14:01:17 +0200 Subject: [PATCH 2/2] Add changelog --- changelog/unreleased/fix-oidc-auth-cache.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 changelog/unreleased/fix-oidc-auth-cache.md diff --git a/changelog/unreleased/fix-oidc-auth-cache.md b/changelog/unreleased/fix-oidc-auth-cache.md new file mode 100644 index 000000000..abd8711e5 --- /dev/null +++ b/changelog/unreleased/fix-oidc-auth-cache.md @@ -0,0 +1,5 @@ +Bugfix: Fix OIDC auth cache + +We've fixed an issue rendering the OIDC auth cache useless. + +https://github.com/owncloud/ocis/pull/5997