minio-dotnet icon indicating copy to clipboard operation
minio-dotnet copied to clipboard

Asp net core api - Access Key problem

Open jigrain opened this issue 1 year ago • 3 comments

I am trying to add MinIo to asp net core. In a regular non web application, I use the following code to create a MinioClient instance and perform operations:

                MinioClient minio = new MinioClient()
                                    .WithEndpoint(endpoint)
                                    .WithCredentials(accessKey, secretKey)
                                    .WithSSL(secure)
                                    .Build();

But when I try to connect it to the asp net core api using the code sample I saw on the main page of this repository, I get an error: The Access Key Id you provided does not exist in our records.

Has anyone faced such problems?

builder.Services.AddMinio(configureClient => configureClient
    .WithEndpoint(endpoint)
    .WithCredentials(accessKey, secretKey));

jigrain avatar Oct 16 '23 11:10 jigrain

Try find config property of your MinioClient in debug mode and check it. Maybe I have similar problem, but I'm not sure https://github.com/minio/minio-dotnet/issues/887

yermakovsergey avatar Oct 17 '23 14:10 yermakovsergey

Try this, the BaseUrl will be ok.

builder.Services.AddMinio(configureClient => configureClient .WithEndpoint(endpoint) .WithCredentials(accessKey, secretKey) .Build() );

S3V3N-11 avatar Oct 18 '23 16:10 S3V3N-11

Try this, the BaseUrl will be ok.

builder.Services.AddMinio(configureClient => configureClient .WithEndpoint(endpoint) .WithCredentials(accessKey, secretKey) .Build() );

Now I get an error: Connection error:The SSL connection could not be established, see inner exception.... Status code=0, response=The SSL connection could not be established, see inner exception. I don't use SSL for my MinIO and accordingly I write ".WithSSL(false)" but as far as I understand it doesn't work for Asp net core format.

jigrain avatar Nov 03 '23 12:11 jigrain