diff --git a/cmd/admin-handlers-users.go b/cmd/admin-handlers-users.go index 593a8d88e..457334216 100644 --- a/cmd/admin-handlers-users.go +++ b/cmd/admin-handlers-users.go @@ -621,6 +621,11 @@ func (a adminAPIHandlers) AddServiceAccount(w http.ResponseWriter, r *http.Reque return } + if createReq.AccessKey == globalActiveCred.AccessKey { + writeErrorResponseJSON(ctx, w, errorCodes.ToAPIErr(ErrAddUserInvalidArgument), r.URL) + return + } + var ( targetGroups []string err error diff --git a/cmd/api-errors.go b/cmd/api-errors.go index 59b5ed90b..ccde67ecb 100644 --- a/cmd/api-errors.go +++ b/cmd/api-errors.go @@ -2021,7 +2021,7 @@ var errorCodes = errorCodeMap{ }, ErrAddUserInvalidArgument: { Code: "XMinioInvalidIAMCredentials", - Description: "User is not allowed to be same as admin access key", + Description: "Credential is not allowed to be same as admin access key", HTTPStatusCode: http.StatusForbidden, }, ErrAdminResourceInvalidArgument: {