-
Notifications
You must be signed in to change notification settings - Fork 84
Description
I've been trying to use the addUser method but I keep getting the error 'The request signature we calculated does not match the signature you provided. Check your key and signing method'
I assumed at first that my access key and secret key were wrong but then I used the same keys with the github.com/minio/minio-go/ library to call the BucketExists method and it worked.
I am initializing both of the libraries in very similar ways as shown bellow
func initializeMinio(minioendpoint string, accessKeyID string, secretAccessKey string) (*minio.Client) {
minioClient, err := minio.New(
minioendpoint,·
&minio.Options{
Creds: credentials.NewStaticV4(accessKeyID, secretAccessKey, ""),
Secure: true,
})
if err != nil {
log.Fatal().Msg(err.Error())
}
return minioClient
}
func initializeMinioAdm(minioendpoint string, accessKeyID string, secretAccessKey string) (*madmin.AdminClient){
mdmClnt, err := madmin.NewWithOptions(
minioendpoint,·
&madmin.Options{
Creds: credentials.NewStaticV4(accessKeyID, secretAccessKey, ""),
Secure: true,
},
)
if err != nil {
log.Fatal().Msg(err.Error())
}
return mdmClnt
}
I am also calling the addUser function in what I assume is the correct way
//access_key is a random string of letters and number of size 20 and secret_key is a random string of letters and numbers of size 40.
err = m.Minio.AdmMinio.AddUser(ctx, *access_key,*secret_key)
if err != nil {
log.Error().Msg("Error making minio user: " + err.Error())
return fiber.NewError(fiber.ErrInternalServerError.Code, "Error making bucket")
}
I have tried writting the access_key and secret_key as hardcoded strings to see if it was a problem with my random string generation but after trying with the values 'testaccesskey1234' and 'testsecretkey1234' I still received the same error.
does anyone know how to resolve this issue?