Vladimir
Vladimir

Reputation: 3

MinIO CopyObjectAsync AuthorizationException

I'm trying to copy an image from one folder to another using the MinIO library. I'm trying to use the CopyObjectAsync method and I'm getting a Minio.Exceptions.AuthorizationException: "The request signature we calculated does not match the signature you provided. Check your key and signing method." How I can solve this problem? The code I'm using

try
{
    var copySourceObjectArgs = new CopySourceObjectArgs()
        .WithBucket("src-img.jpg")
        .WithObject("srcbucket");
    var copyObjectArgs = new CopyObjectArgs()
        .WithBucket("new-img-name.jpg")
        .WithObject("newbucket")
        .WithCopyObjectSource(copySourceObjectArgs);

    await _minIOClient.CopyObjectAsync(copyObjectArgs).ConfigureAwait(false);
}
catch (Exception exception)
{
    Console.WriteLine(exception.ToString());
}

_minIOClient code

_minIOClient = new MinioClient()
.WithEndpoint(EndPoint)
.WithCredentials(AccessKey, SecretAccessKey)
.WithSSL()
.Build();

Other methods such as adding and deleting images are performed correctly. This may be important: in a real project the image names are Guid.

Upvotes: 0

Views: 26

Answers (0)

Related Questions