-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Confirm Signup Gives Me UserUnAuthenticatedException: User needs to be authenticated to call this API. #13071
Comments
@didemkkaslan From a quick glance it looks like I am having the same issue. Check if your code works on any version between v6.0.0 and v6.0.9. If it works we may be facing the same issue. As a temporary fix I added a small delay before the getCurrentUser() function:
|
@danieljandey unfortunately lowering the version didn't fix it for me. I've also tried setTimouts with no luck. The error is thrown when confirmSignup runs.
I think this code internally calls getCurrentUser |
hello @didemkkaslan . Amplify will call Saying that, the main issue is due to Amplify not being able to set tokens in the storage mechanism. This can be due to a domain mismatch while using cookies. |
Hello @israx I've tried to create my own tokenProvider and credentialsProvider for this reason but this time I get Auth UserPool not configured error. Is below implementation is the way to go if I want to set auth tokens for also different domains ( in this case msteams.com ) Thanks for the help
|
can you override only the storage mechanism from the cognito token provider ? Something like
for more information you can review this docs: https://docs.amplify.aws/react/build-a-backend/auth/manage-user-session/#update-your-token-saving-mechanism |
can you add the |
Thank you @israx ✨ the problem is solved with the domain setting. For anyone encountering this issue I want to share the latest configuration that fixed my problem
|
@didemkkaslan, sounds like @israx's helpful replies helped get things unblocked here! Are there any lingering issues with this at this time? |
Yes it’s fully resolved right now 🚀
|
Before opening, please confirm:
JavaScript Framework
Next.js
Amplify APIs
Authentication
Amplify Version
v6
Amplify Categories
auth
Backend
CDK
Environment information
Describe the bug
We are building a Tab for microsoft teams. One of our pages
/integration/microsoft-teams
will be embedded inside microsoft teams app Spiky.ai tab. So I'm trying to authenticate user in this page.if
signUpWithMSTeamsToken
gives me UsernameExistsException then I try to authenticate usingsignInWithMSTeamsToken
function. where the error occurs.the last thing I see in the console is this 'confirming sign in with custom challenge' message. confirmSignIn throws UserUnAuthenticatedException: User needs to be authenticated to call this API. error.
This started to happen after migrating to amplify v6 the old working code was
Expected behavior
It should complete the custom challenge with no errors and sign user in.
Reproduction steps
SignIn with CUSTOM_WITHOUT_SRP auth flow type and try to confirmSignIn
Code Snippet
Log output
aws-exports.js
No response
Manual configuration
No response
Additional configuration
No response
Mobile Device
No response
Mobile Operating System
No response
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
No response
The text was updated successfully, but these errors were encountered: