aws / aws-aspnet-cognito-identity-provider

ASP.NET Core Identity Provider for Amazon Cognito
https://aws.amazon.com/developer/language/net/
Apache License 2.0
215 stars 89 forks source link

OperationCanceledException: The operation was canceled. RESPONSE Required #126

Closed DragonMastery closed 5 years ago

DragonMastery commented 5 years ago

I am following this video, by installing the sample project in this repo and it is not working... (again I am using the sample project, the only thing I have changed is the appsettings.Development.json for my user pool)

OperationCanceledException: The operation was canceled.

System.Net.Http.HttpClient.HandleFinishSendAsyncError(Exception e, CancellationTokenSource cts)
System.Net.Http.HttpClient.FinishSendAsyncUnbuffered(Task<HttpResponseMessage> sendTask, HttpRequestMessage request, CancellationTokenSource cts, bool disposeCts)
System.Net.Http.HttpClient.GetStringAsyncCore(Task<HttpResponseMessage> getTask)
Amazon.Runtime.Internal.Util.AsyncHelpers+<>c__DisplayClass1_1<T>+<<RunSync>b__0>d.MoveNext()
Amazon.Runtime.Internal.Util.AsyncHelpers+ExclusiveSynchronizationContext.BeginMessageLoop() in AsyncHelpers.cs
Amazon.Runtime.Internal.Util.AsyncHelpers.RunSync<T>(Func<Task<T>> task) in AsyncHelpers.cs
Amazon.Util.AWSSDKUtils.DownloadStringContent(Uri uri, TimeSpan timeout, IWebProxy proxy) in AWSSDKUtils.cs
Amazon.Util.EC2InstanceMetadata.GetItems(string relativeOrAbsolutePath, int tries, bool slurp) in EC2InstanceMetadata.cs
Amazon.Util.EC2InstanceMetadata.get_IAMSecurityCredentials() in EC2InstanceMetadata.cs
Amazon.Runtime.DefaultInstanceProfileAWSCredentials.FetchCredentials() in DefaultInstanceProfileAWSCredentials.cs
Amazon.Runtime.DefaultInstanceProfileAWSCredentials.GetCredentials() in DefaultInstanceProfileAWSCredentials.cs
Amazon.Runtime.DefaultInstanceProfileAWSCredentials.GetCredentialsAsync() in DefaultInstanceProfileAWSCredentials.cs
Amazon.Runtime.Internal.CredentialsRetriever.InvokeAsync<T>(IExecutionContext executionContext) in CredentialsRetriever.cs
Amazon.Runtime.Internal.RetryHandler.InvokeAsync<T>(IExecutionContext executionContext)
Amazon.Runtime.Internal.RetryHandler.InvokeAsync<T>(IExecutionContext executionContext) in RetryHandler.cs
Amazon.Runtime.Internal.CallbackHandler.InvokeAsync<T>(IExecutionContext executionContext)
Amazon.Runtime.Internal.CallbackHandler.InvokeAsync<T>(IExecutionContext executionContext)
Amazon.Runtime.Internal.ErrorCallbackHandler.InvokeAsync<T>(IExecutionContext executionContext)
Amazon.Runtime.Internal.MetricsHandler.InvokeAsync<T>(IExecutionContext executionContext)
Amazon.Extensions.CognitoAuthentication.CognitoUserPool.GetPasswordPolicyTypeAsync()
Amazon.AspNetCore.Identity.Cognito.CognitoPasswordValidator.ValidateAsync(UserManager<CognitoUser> manager, CognitoUser user, string password)
Amazon.AspNetCore.Identity.Cognito.CognitoUserManager<TUser>.ValidatePasswordInternal(TUser user, string password)
Amazon.AspNetCore.Identity.Cognito.CognitoUserManager<TUser>.CreateAsync(TUser user, string password, IDictionary<string, string> validationData)
Samples.Areas.Identity.Pages.Account.RegisterModel.OnPostAsync(string returnUrl) in Register.cshtml.cs

                var result = await _userManager.CreateAsync(user, Input.Password);
assyadh commented 5 years ago

Do you have a default credentials profile on your dev environment?

You can get one by using the AWS Cli or the visual studio toolkit for AWS.

DragonMastery commented 5 years ago

I have setup everything the way it it supposed to be setup, as the video directs me to.

DragonMastery commented 5 years ago

Oh, ok I understand now, I didn't realize that I needed a IAM user for programmatic access to use Cognito. I setup the credentials with AWS Toolkit in Visual Studio and it works perfectly. Thanks for the quick response!

assyadh commented 5 years ago

No problem!