Comments (10)
The values you entered look correct. Are you sure there is no white space?
When is the error occurring?
Do you have the AWS Cli or toolkit for visual studio installed with a default profile?
from aws-aspnet-cognito-identity-provider.
When I fill out the register (new account) form and submit the form. Occurs on page Register.cshtml.cs:
When the userManager.CreateAsync function is called.
No white spaces in the settings.
public async Task OnPostAsync(string returnUrl = null)
{
returnUrl = returnUrl ?? Url.Content("~/");
if (ModelState.IsValid)
{
var user = _pool.GetUser(Input.UserName);
user.Attributes.Add(CognitoAttribute.Email.AttributeName, Input.Email);
user.Attributes.Add(CognitoAttribute.PhoneNumber.AttributeName, Input.Phone);
var result = await _userManager.CreateAsync(user, Input.Password);
It's a brand new ASPNetCore 2.1.1 Web Application with your sample code ported in. Not sure what AWS Cli (is installed on this dev box) has to do with this issue as that is not called during the DotNetCore code execution.
Installed
Identity.Cognito 1.0.0
Extensions.CognitoAuthentication 1.0.3
ASPNETCore.App 2.1.1
ASPNETCore.Razor.Design 2.1.2
NETCore.App 2.1.0
VisualStudio.Web.CodeGeneration.Design 2.1.7
from aws-aspnet-cognito-identity-provider.
I have not added any of the other AWS DotNet SDKs yet as this is a blank (standard DotNet Core template) project and I was first trying to get it to substitute Cognito for the normal DotNet db/authentication before adding anything else in.
from aws-aspnet-cognito-identity-provider.
The code that is being executed is ported in verbatim from:
So created a brand new project, ported in "all" code/references/libraries/etc.
https://github.com/aws/aws-aspnet-cognito-identity-provider/tree/master/samples/Samples
from aws-aspnet-cognito-identity-provider.
I would just like to get it to work. I can upload the entire project for you if you like. What I did is a newer update from your original sample project with regards to the DotNet version used. I could simply delete the Cognito accounts and create new ones afterwords. If we get it to work you could post this as a "new/updated" working sample for the community.
from aws-aspnet-cognito-identity-provider.
I tried loading/running your Samples.sln project. It does compile but it errors out when you try to run it.
An unhandled exception occurred while processing the request.
UriFormatException: Invalid URI: The hostname could not be parsed.
System.Uri.CreateThis(string uri, bool dontEscape, UriKind uriKind)
TargetInvocationException: Exception has been thrown by the target of an invocation.
System.RuntimeMethodHandle.InvokeMethod(object target, object[] arguments, Signature sig, bool constructor, bool wrapExceptions)
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) in ClientConfig.cs
Amazon.Runtime.ClientConfig.DetermineServiceURL() in ClientConfig.cs
Amazon.Runtime.Internal.DefaultRetryPolicy..ctor(IClientConfig config) in DefaultRetryPolicy.cs
Amazon.Runtime.AmazonServiceClient.BuildRuntimePipeline() in AmazonServiceClient.cs
Anyway mines initializes just fine. Only seems to have an issue with the credentials.
from aws-aspnet-cognito-identity-provider.
I did put in the appsettings.json settings similar to my own project as they are missing in the sample of course.
from aws-aspnet-cognito-identity-provider.
Hi,
This definitely looks like a credentials issue.
You don't need to add any other SDK, they are already referenced by the NuGet packages.
Sorry for not responding earlier, I have been pulled into various other issues.
Can you follow the instructions here:
https://github.com/aws/aws-aspnet-cognito-identity-provider/blob/master/docs/1-Setup.md
Especially around setting up the Visual Studio Toolkit and a default AWS Profile.
While working on a development environment, the SDKs need access to credentials. This is done by setting up a profile using the AWS CLI:
https://docs.aws.amazon.com/toolkit-for-visual-studio/latest/user-guide/setup.html
https://docs.aws.amazon.com/sdk-for-net/v3/ndg/welcome.html
This is not required in a production environment as the credentials will be retrieve from the EC2 instance metadata.
Feel free to upload the project for me, I can have a look, just make sure to obfuscate any secrets.
It may work on my machine as I have the CLI installed with a default profile, I will let you know once the project is uploaded.
from aws-aspnet-cognito-identity-provider.
from aws-aspnet-cognito-identity-provider.
Might be related to: #80
from aws-aspnet-cognito-identity-provider.
Related Issues (20)
- Ways of supporting social login HOT 2
- Security: Defaults require secrets be published in unencrypted configuration files. HOT 6
- Sample App is nonfunctional for core common use cases and actively misleads users, seems abandoned. HOT 6
- Getting error "Unable to get IAM security credentials from EC2 Instance Metadata Service." while trying to login HOT 4
- AWSCognitoClientOptions doesn't contain a Region property (which is required by AWS) HOT 5
- Use inclusive pronouns in documentation. HOT 2
- Any plans to support .NET 5.0? HOT 4
- Implementing MFA suppression via remembered devices, getting 'Invalid device key given.' exception HOT 6
- Sample not working properly - Unable to get IAM security credentials from EC2 Instance Metadata Service. HOT 3
- Unable to retrieve UserPoolClientId and UserPoolClientSecret form AWS Parameter Store HOT 4
- Ability to reload AWSOptions after ASP.NET Core Lambda Startup HOT 19
- How to retrieve the list of all roles (groups) HOT 3
- AmazonCognitoIdentityProviderClient Usage HOT 6
- RemovePasswordAsync() fails for an unconfirmed user HOT 4
- Sign Out from all "active sessions" HOT 4
- RevokeToken behavior for multiple logins
- Support for External Providers HOT 4
- Check Password for unconfirmed user. HOT 5
- PasswordSignInAsync or CheckPasswordSignInAsync and SignInAsync are not persisting auth cookie User.Identity.IsAuthenticated is false HOT 6
- We can no longer search or find users with this sdk HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aws-aspnet-cognito-identity-provider.