Post with api aws

0

I'm trying to make a Post for a AWS service. Home I have never worked with AWS and I am studying some links and I am initially doing a connection test using this code:

private static async void SignInUserAsync()
{
    var provider = new AmazonCognitoIdentityProviderClient(new AnonymousAWSCredentials(), RegionEndpoint.GetBySystemName("us-east-1")); 
    try
    {
        string Access_Key = "ZZZZZZZZZZZZOOOOOOO";                
        string Secret_Key = "XXXXXXXXXXYYYYYYYYYYYYY";

        var authReq = new AdminInitiateAuthRequest
        {
            AuthFlow = AuthFlowType.ADMIN_NO_SRP_AUTH,
            UserPoolId = Access_Key,
            ClientId = Secret_Key
        };

        AdminInitiateAuthResponse authResp = await provider.AdminInitiateAuthAsync(authReq);

        if (authResp != null)
        {
            Console.WriteLine("Autenticação ok!");
        }
        else
        {
            Console.WriteLine("falhou!");
        }

    }
    catch (Exception ex)
    {
        throw new Exception(ex.Message);
    }
}

I installed the SDK:

AWS SDK for .NET

The following extensions in VS2017:
AWS Toolkit for Visual Studio 2017

The question is that I can not authenticate with AWS because it returns error 400, the key and the access code sent by the client:

    
asked by anonymous 21.11.2018 / 11:58

1 answer

0

Dude could you try to use this method to authenticate? link

AmazonS3Config config = new AmazonS3Config();

    _s3Client = new AmazonS3Client(
        "00000000000000000000", //ID_Access
        "0000000000000000000000000000000000000000", //Key_Access
        config
    );

Here you will find all the AWS documentation that is helping me a lot so far

link

    
24.11.2018 / 01:04