mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-02-25 19:47:05 -05:00
create mapping in cache for subject => sessionid
Signed-off-by: Christian Richter <c.richter@opencloud.eu>
This commit is contained in:
committed by
Christian Richter
parent
762062bfa3
commit
cb38aaab16
@@ -124,6 +124,18 @@ func (m *OIDCAuthenticator) getClaims(token string, req *http.Request) (map[stri
|
||||
if err != nil {
|
||||
m.Logger.Error().Err(err).Msg("failed to write session lookup cache")
|
||||
}
|
||||
|
||||
// create an additional entry mapping subject to session id
|
||||
if sub := aClaims.Subject; sub != "" {
|
||||
err = m.userInfoCache.Write(&store.Record{
|
||||
Key: sub,
|
||||
Value: []byte(sid),
|
||||
Expiry: time.Until(expiration),
|
||||
})
|
||||
if err != nil {
|
||||
m.Logger.Error().Err(err).Msg("failed to write subject lookup cache")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
||||
Reference in New Issue
Block a user