DEV Community

Discussion on: Authentication using the Amazon Cognito to an Angular application

Collapse
 
theitalianjob profile image
Edoardo Zecchi

Hello,
I've tried all the code but it's seems I must install amplify cli and use commands "amplify add auth" and "amplify pull" to work with your example...
where I'm wrong?

Collapse
 
rodrigokamada profile image
Rodrigo Kamada

Hi Edoardo, you don't need Amplity to make this example. Did something not work?

Collapse
 
theitalianjob profile image
Edoardo Zecchi

This is the error I receive on console when I try to call
"Auth.signIn(user.email, user.password)"

[ERROR] 13:56.48 AuthError - Error: Amplify has not been configured correctly. The configuration object is missing required auth properties. This error is typically caused by one of the following scenarios:

  1. Did you run amplify push after adding auth via amplify add auth? See aws-amplify.github.io/docs/js/auth... for more information
  2. This could also be caused by multiple conflicting versions of amplify packages, see (docs.amplify.aws/lib/troubleshooti...) for help upgrading Amplify packages.
Thread Thread
 
rodrigokamada profile image
Rodrigo Kamada

Did you configure the userPoolId and userPoolWebClientId parameters in the environment files?

Thread Thread
 
theitalianjob profile image
Edoardo Zecchi

solved... I've changed in camelCase the cognito "Auth" property and this caused the error... I have to insert "eslint-disable" to remove ide warnings...

Amplify.configure({
// eslint-disable-next-line @typescript-eslint/naming-convention
Auth: environment.cognito,
});