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.

posta 2 anni fa689 visualizzazioni
1 Risposta


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.


con risposta 2 anni fa
profile picture
verificato 10 giorni fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande