diff --git a/cmd/admin-handlers-users.go b/cmd/admin-handlers-users.go index 0acacc6591cd6..95de013cee705 100644 --- a/cmd/admin-handlers-users.go +++ b/cmd/admin-handlers-users.go @@ -530,6 +530,9 @@ func (a adminAPIHandlers) AddServiceAccount(w http.ResponseWriter, r *http.Reque errors.New("service accounts cannot be generated for temporary credentials without parent")), r.URL) return } + if targetUser == "" { + targetUser = cred.ParentUser + } } targetGroups = cred.Groups }