Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Asp net core api - Access Key problem #885

Open
jigrain opened this issue Oct 16, 2023 · 3 comments
Open

Asp net core api - Access Key problem #885

jigrain opened this issue Oct 16, 2023 · 3 comments

Comments

@jigrain
Copy link

jigrain commented Oct 16, 2023

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));
@yermakovsergey
Copy link

yermakovsergey commented Oct 17, 2023

Try find config property of your MinioClient in debug mode and check it. Maybe I have similar problem, but I'm not sure
#887

@S3V3N-11
Copy link

Try this, the BaseUrl will be ok.

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

@jigrain
Copy link
Author

jigrain commented Nov 3, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants