Request revatoken via machine auth after autoprovsioning user (#4690)

To successfully authenticate a user after it was autoprovisioned, we
need to get a valid reva token.

Fixes: #4616
This commit is contained in:
Ralf Haferkamp
2022-09-27 21:51:18 +02:00
committed by GitHub
parent 5eaf0dfe7b
commit e4c28def8a
2 changed files with 10 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
Bugfix: Fix authentication for autoprovisioned users
We've fixed an issue in the proxy, which made the first http request of an
autoprovisioned user fail.
https://github.com/owncloud/ocis/issues/4616

View File

@@ -76,6 +76,10 @@ func (m accountResolver) ServeHTTP(w http.ResponseWriter, req *http.Request) {
if err != nil {
m.logger.Error().Err(err).Msg("Autoprovisioning user failed")
}
user, token, err = m.userProvider.GetUserByClaims(req.Context(), "userid", user.Id.OpaqueId, true)
if err != nil {
m.logger.Error().Err(err).Str("userid", user.Id.OpaqueId).Msg("Error getting token for autoprovisioned user")
}
}
if errors.Is(err, backend.ErrAccountDisabled) {