Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SignIn with confirmed user failed #646

Closed
Jasminou opened this issue Apr 12, 2018 · 17 comments
Closed

SignIn with confirmed user failed #646

Jasminou opened this issue Apr 12, 2018 · 17 comments
Labels
Auth Related to Auth components/category investigating This issue is being investigated

Comments

@Jasminou
Copy link

Do you want to request a feature or report a bug?
report bug
What is the current behavior?
confirmed user can not signIn, i'm getting an error message: signin failed,
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than AWS Amplify.

i'm using AWS amplify, i'm able to sign up a user and getting verification code by email, once i confirm it, i receive succes, but when i tried to login in with my new user the sign in failed.

What is the expected behavior?
supposed to be able to sign in with the new confirmed user in my user pool
Which versions of Amplify, and which browser / OS are affected by this issue? Did this work in previous versions?
last version of amplify, browser : Google chrome/ Windows.
first time i'm using amplify dont know if its was working before
You can turn on the debug mode to provide more info for us by setting window.LOG_LEVEL = 'DEBUG'; in your app.

@richardzcode
Copy link
Contributor

Hey @Jasminou could you set LOG_LEVEL to 'DEBUG'? Then we can have detailed logs of what was happening during sign in.

@richardzcode richardzcode added the Auth Related to Auth components/category label Apr 12, 2018
@Jasminou
Copy link
Author

yes,sure this is what I've when i try to sign in with a confirmed user, ( i don't know if i miss a something in the configuration of the user pool) ,because when i create a user from aws console via the website, it works. thx for your helps @richardzcode
capture 1png
capture2
capture3
capture 4png
capture5

@Jasminou
Copy link
Author

@richardzcode here is the network request
status code 200
{"ChallengeName":"PASSWORD_VERIFIER",
"ChallengeParameters":{"SALT":"8644d44fff86479d76d93ebeeada0501",
"SECRET_BLOCK":"mAJRhJhJPTWxxxxxc/nk",
"SRP_B":"d8xxxxxxxxxx",
"USERNAME":"yasmine",
"USER_ID_FOR_SRP":"yasmine"}}

status code 200
{"AuthenticationResult":
{"AccessToken":"e8q_xxxxxxxx,"ExpiresIn":3600,
"IdToken":"uDxxxxxxxxg",
"RefreshToken":"Txxxxxxx","TokenType":"Bearer"},"ChallengeParameters":{}}

status code 200
{"AuthenticationResult":
{"AccessToken":"e8q_xxxxxxxx,"ExpiresIn":3600,
"IdToken":"uDxxxxxxxxg",
"RefreshToken":"Txxxxxxx","TokenType":"Bearer"},"ChallengeParameters":{}}

status code 400
{"__type":"ValidationException",
"message":"1 validation error detected: Value 'us-east-2:829033370241:userpool/us-east-2_xxxxxx' at 'identityPoolId' failed to satisfy
constraint: Member must satisfy regular expression pattern: [\w-]+:[0-9a-f-]+"}

@richardzcode
Copy link
Contributor

richardzcode commented Apr 13, 2018

Looks like it is challenging with 'PASSWORD_VERIFIER' which Amplify does not handle right now. I am looking into this right now.

@Jasminou
Copy link
Author

ok thx, do you think its possible to have a work around to change the 'password_verifier' and use another challenging that is supported ?

@richardzcode
Copy link
Contributor

Sorry @Jasminou . I was wrong. Actually 'PASSWORD_VERIFIER' was not the cause, it is handled internally in cognito, so we don't need to do anything for it. From the sequence of network and logs, confirmation actually succeeded. But loading credentials with the session failed.

I am guessing you are not using Mobile Hub aws_exports.js? Is it okay for you to share what you have configured to identityPoolId?

@richardzcode
Copy link
Contributor

If not, could you confirm if it follows pattern of [\w-]+:[0-9a-f-]+?

Basically that means something like: us-east-1:b0ee1234-5ae6-7c89-0123-45dd67890c1d, notice latter part must not have letters outside of a - f.

@richardzcode richardzcode added the investigating This issue is being investigated label Apr 13, 2018
@Jasminou
Copy link
Author

@richardzcode , yes i'm not using mobile Hub aws_export.js, yes it's possible to share, below my config:
` amplify: {
Auth: {

  identityPoolId: 'us-east-2:829033370241:userpool/us-east-2_HBVMSuMGx',
  region: 'us-east-2',
  userPoolId: 'us-east-2_HBVMSuMGx',
  userPoolWebClientId: '369dr816imj748s1oqik954f08',

}
}

@richardzcode
Copy link
Contributor

I think the 'identityPoolId' is wrong. Remove the userpool part may work.

  identityPoolId: 'us-east-2:829033370241',
  region: 'us-east-2',
  userPoolId: 'us-east-2_HBVMSuMGx',
  userPoolWebClientId: '369dr816imj748s1oqik954f08',

@Jasminou
Copy link
Author

@richardzcode, removing the part with the userpool don't fixe the problem, also i've this message error, when i remove the userpool part: {"__type":"ResourceNotFoundException","message":"IdentityPool 'us-east-2:829033370241' not found."}

@Jasminou
Copy link
Author

@richardzcode , how the sign in work fine when i create a user from the console of the identityPoolId is wrong, the identityPoolID is suppose to match the Pool ARN config right ?

capturepp

@Jasminou
Copy link
Author

Jasminou commented Apr 13, 2018

@richardzcode , i found this, https://forums.aws.amazon.com/thread.jspa?threadID=231553
but what if we dont want to support a federated user pool in my app?

@richardzcode
Copy link
Contributor

yes that thread is correct. Basically user pool is for user management, identity pool for authenticating aws service requests.

@Jasminou
Copy link
Author

ok thx i will try to follow what they said thx again for u help

@Jasminou
Copy link
Author

@richardzcode you were right, the pool id was wrong, its working now

@richardzcode
Copy link
Contributor

@Jasminou we are working on #655 which means your sign in wouldn't fail without identity pool. However in this case client don't have credentials although signed in. Theoretically if you don't consume other AWS services this should be okay.

@github-actions
Copy link

This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels or Discussions for those types of questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Auth Related to Auth components/category investigating This issue is being investigated
Projects
None yet
Development

No branches or pull requests

2 participants