amplify-js: Auth.signIn throws NotAuthorizedException Incorrect username or password in ios
Do you want to request a feature or report a bug? Bug
What is the current behavior? In a react-native app I’m using Auth.signIn(username, password) to authenticate users.
The authentication success in android devices But in some ios devices the getting the following error. NotAuthorizedException. Incorrect username or password
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.
What is the expected behavior? In ios devices, should be able to authenticate with the same username and password as in android devices.
Which versions of Amplify, and which browser / OS are affected by this issue? Did this work in previous versions? “aws-amplify”: “^0.4.8” OS: ios
You can turn on the debug mode to provide more info for us by setting window.LOG_LEVEL = 'DEBUG'; in your app.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 2
- Comments: 31 (13 by maintainers)
Commits related to this issue
- fix(build): Prevent tree-shaking of crypto-js/lib-typedarrays (#2718) Fixes #1181 — committed to aws-amplify/amplify-js by manueliglesias 5 years ago
- fix(build): Prevent tree-shaking of crypto-js/lib-typedarrays (#2718) Fixes #1181 — committed to epidemicsound/amplify-js by manueliglesias 5 years ago
FWIW my issue was unrelated - I had a single missing char from a cut n paste error for my user pool id. It seems the messaging is a bit wrong in this scenario where the identity pool is correct but the pool was incorrect - the only thing that did not work was logging in.
VS Code gave me a big clue 😛
Awesome news @mrowles !
post-mortem:
amazon-cognito-identity-jsis doing an import like this:where
TypedArraysis unused; this is presumably making bundlers drop it when doing tree-shaking.the import was changed to:
Reference: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import#Import_a_module_for_its_side_effects_only
@mrowles
I think I found the issue, while I send a PR, can you try adding this import before you import
aws-amplify?@mrowles
Ok, I can reproduce with a simple
vs
Let me keep looking into this, definitely a bundling issue
Did anyone figure this out? It’s happening to me now, same symptoms however it’s just web, not iOS or using Ionic. It works locally, but not in production, user is CONFIRMED etc.
@powerful23 Surely this is a widespread issue, it’s been 7 months since this was opened? I raised this as a ticket with business support too, but they don’t seem to have any clue.
@tonyatoms you should put that right after those import statements under
index.js.As a further observation it appears that the issue happens only on --prod ionic cordova builds
Nuts, looks good on local prod build! Pushing to my prod env to see if all swell, but positive outlook so far 😁Cheers
Edit: @manueliglesias can confirm this worked. Well done mate, this was a long outstanding issue that I (and others) struggled with for months.
@mrowles I’m wondering the same thing. Running “@aws-amplify/auth” v. 1.2.6 in create-react-app. Everything runs fine in Android, browser, and >= iOS 7. As far as I can tell, my issue is with
Auth.signInonly. I’m having good luck withAuth.forgotPasswordandAuth.forgotPasswordSubmitbut the authentication flow fails there being thatAuth.signInmust be called at the end ofAuth.forgotPasswordSubmit- I’m assuming this since the new password is successfully submitted and changed, but still gets the error “NoAuthorizedException” that @manoramahp was initially getting (and what I’m getting when runningAuth.signIn.