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
213 stars 89 forks source link

Update NuGet package and Sample to .NET Core 3.1 #199

Closed normj closed 3 years ago

normj commented 3 years ago

image

Description of changes: The Amazon.AspNetCore.Identity.Cognito was targeting .NET Standard 2.0 and .NET Core 3.0. Since .NET Core 3.0 is out of support I updated the .NET Core 3.0 to 3.1. A major version bump was set to signify the potential breaking change but I don't expect much .NET Core 3.0 usage.

The sample in the repo had the following updates:

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

normj commented 3 years ago

I followed the steps in Setup.md and added a AWS to the appsettings.json file. When I hit play in VS to launch IISExpress, I get an InternalServerException:

UriFormatException: Invalid URI: The hostname could not be parsed.
System.Uri.CreateThis(string uri, bool dontEscape, UriKind uriKind)
System.Uri..ctor(string uriString)
Amazon.Runtime.ClientConfig.GetUrl(RegionEndpoint regionEndpoint, string regionEndpointServiceName, bool useHttp, bool useDualStack)
Amazon.Runtime.ClientConfig.DetermineServiceURL()
Amazon.Runtime.Internal.DefaultRetryPolicy..ctor(IClientConfig config)
Amazon.Runtime.AmazonServiceClient.BuildRuntimePipeline()
Amazon.Runtime.AmazonServiceClient..ctor(AWSCredentials credentials, ClientConfig config)
Amazon.CognitoIdentityProvider.AmazonCognitoIdentityProviderClient..ctor(AWSCredentials credentials, AmazonCognitoIdentityProviderConfig clientConfig)

Is there more setup required?

Found the problem 1-SETUP.md incorrectly says:

Just make the necessary changes to the following properties to the appsettings.json file

README.md has the correct instructions:

For a development user pool edit either the appsettings.Development.json file or the projects secrets.json file.

After updating the stub in appsettings.Development.json I was able to launch the website correctly.

Can you updated 1-SETUP.md to match the verbiage in README.md.

Updated 1-Setup.md file to use appsettings.Development.json

iofluxdev1 commented 3 years ago

Legend, so glad I found this PR! Resolves our issue that have been around for a year wrt password resetting.

var code = await _userManager.GeneratePasswordResetTokenAsync(user);

used to work then one day stopped working and now it seems

await user.ForgotPasswordAsync();

is the way to go.