AWS Cognito - .NET Framework


I'm trying to connect to AWS Cognito from a .net Framework project.

I can sign up succesfully but when I need to sign in, throws me an error: "User pool {userPool} client does not exist".

This is my code:

private async Task<bool> CheckPasswordAsync(string userName, string password)

                var authReq = new AdminInitiateAuthRequest
                    UserPoolId = ConfigurationManager.AppSettings["USERPOOL_ID"],
                    ClientId = ConfigurationManager.AppSettings["CLIENT_ID"],
                    AuthFlow = AuthFlowType.ADMIN_NO_SRP_AUTH,
                authReq.AuthParameters.Add("USERNAME", userName);
                authReq.AuthParameters.Add("PASSWORD", password);

                AdminInitiateAuthResponse authResp = await _client.AdminInitiateAuthAsync(authReq);

                var auts = authResp;
                return true;
            catch(Exception ex)
                var exc = ex.Message;
                return false;

I don't know if I need to add more information to the method.

The user pool exists and is the same that I have in appSettings.

Any idea about what's wrong?

Thanks in advance.

gefragt vor 2 Jahren694 Aufrufe
1 Antwort


Thank you for your question.

Your code is missing some prerequisite steps needed to register the user pool. I have attached a document that shows the step by step on how to register and authenticate with Cognito user pools. I have also included a document that contains code examples.


beantwortet vor 2 Jahren
profile picture
überprüft vor 14 Tagen

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen