-
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
Amplify auth - Issue moving from sandbox to production #13675
Comments
Hello, @vrajasekhar1 👋 and thanks for creating this issue after stopping by our Discord Office Hours. Want to confirm a few things to better understand how the app has been set up so we can get to the root cause of the issue here. Is your support case still ongoing and can you provide the case id # (just in case there's relevant information I can look into)? Also, can you check in the Cognito console to see if you have only 1 App Client ID under Cognito Console > User Pools > Your App's User Pool > App Integration Tab > Scroll to bottom to see the "App Client List"? |
Hi Chris, Thanks. |
Hi Chris, any further update on this please? This issue is blocking us moving to production. Please let me know if any further info required from my side. Thank you so much for taking care of this issue. |
@vrajasekhar1, I haven't been able to reproduce this on my own apps that I've moved from dev to prod. Can you check to see if within your user pool in the Cognito console to see if the SNS phone number is registered with an associated ARN? And on the SNS side of things, is the phone number still showing that it's in "sandbox mode"? Or has the phone number been fully "verified" at this point? Here's a couple of links that could help determine this: |
Hi Chris,
Following is more detail about what we have in different consoles. Cognito User pool console: SNS Console: AWS End User Messaging Console: Now my questions / confusions are
Everything seems unclear and there is no proper documentation how Cognito works when we move SNS to production. We can show our env in a remote session incase that helps. Please let me know. Thanks, |
Hey @vrajasekhar1 👋 can you share how you have your backend auth resource configured? |
Hi @josefaidt, |
Hey @vrajasekhar1 thanks for posting that! do you have an override applied to configure Cognito with the SNS resource? The override would allow you to conditionally apply the SNS config depending on the env you are deploying to, and exposes the CloudFormation resource being generated by auth. On the user pool resource you can set the |
Hi @josefaidt Just couple of changes we have done in Cognito user pool console are:
Thanks, |
@josefaidt Are you saying we will have to override SNS resources to make this work? Does this not work with default configuration provided by Amplify? Can we do a quick remote session so that you can take a look at our env and suggest what steps we can take? Thanks. |
Hey @vrajasekhar1 thanks for clarifying! Changes made in the console may be removed on the next push of your resource. This is typically dependent on the type of change and whether the CloudFormation template generated by Amplify that describes the resource configuration has a default value set for this property. To maintain the reference to your SNS resource across subsequent deployments and/or other environments you can override the auth configuration generated by Amplify. By default the |
Hi @josefaidt We have applied override with SmsConfiguration and did amplify push. It has updated SNS region in Cognito console to ap-south-1 as per override configuration. However, no change in the SMS functionality. Amplify Auth SNS mode is still set to sandbox and we still can not send SMS to unverified phone numbers. Please advise how to move forward on this. Somehow Cognito does not recognise that we have production access in the given region. Please let me know if we can do a quick remote session to resolve this. Thanks. |
Hey @vrajasekhar1 is the sandbox mode displaying in the SNS console or the Cognito console? |
Hi @josefaidt Our SNS Console shows: However, Amplify Studio console and Cognito console show that we are still in sandbox mode. Please Note: |
Hey @vrajasekhar1 thanks for clarifying! can you verify whether the originating identity is verified in your SNS console? the configuration looks fine |
Hi @josefaidt I guess we are missing something trivial or there is some uncovered bug with Cognito/SNS. A quick remote session of 10-15 mins would really help and saves lot of time. Can we do a quick remote session today if possible? I am available on discord. Thanks. |
Hi @josefaidt , Thanks. |
Hey @vrajasekhar1 can you confirm whether the appropriate For optimal results it is recommended to use the same region as your user pool https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-sms-settings.html#sms-choose-a-region |
Hi @josefaidt Thanks. |
Hey @vrajasekhar1 thanks for clarifying. The configuration appears correct. Would you mind reaching out to AWS Support for more insight into the cross-region configuration with Cognito and SNS? https://aws.amazon.com/contact-us/ |
Hi @josefaidt Could you please share your observations/findings about this bug so far? To my knowledge, we followed all steps as per the documentation and Amplify still does not recognise that SNS is in production mode, isn’t it supposed to be a bug that needs to be fixed? |
@vrajasekhar1, our Discord server (where I think you started this conversation/issue from) may be a better route for doing a screenshare or follow up. But were you able to reach out to the AWS Support team on this yet? I think you're spot on that our documentation will only take you so far into getting the SNS account ready for production, and then we rely on/link the Pinpoint docs directly here. I ask because this may be something that we can't impact much on the Amplify side. |
Hi Chris, Please note, we did follow everything as per SNS & Pinpoint documentation and we are able to send SMS using SNS console, but Amplify still shows SNS mode as sandbox and can not send SMS to unverified phone numbers. Assuming there is a dependency issue with SNS/Pinpoint and Amplify does not work as expected, do you still track the issue with Amplify and ensure issue gets resolved OR you would simply redirect the customers to work with other teams? Just trying to understand the protocol. |
@vrajasekhar1, there are some steps in the SNS and Pinpoint setup process that we don't have fully documented on the Amplify side in the event that the Pinpoint documentation or steps change. However, we've heard similar frustrations in the past on getting numbers set up for production when going through this flow. Can you send me a DM on our Discord server so that we can set up a day/time to review this on a call? Don't want you to share any contact information publicly on the Github repo here. I'll also be marking this issue as a documentation feature request to ensure the docs and process for setting up the SNS account is thorough and reviewed again in full detail. |
@cwomack , thanks for checking this. I have sent you a DM on discord. We can connect anytime thats convenient for you. |
Before opening, please confirm:
JavaScript Framework
Next.js
Amplify APIs
Authentication
Amplify Version
v6
Amplify Categories
auth
Backend
Amplify CLI
Environment information
Describe the bug
We are building a solution with Amplify as backend, where users signup using their mobile number.
Upon signup, Cognito sends a verification code to user’s mobile number and we confirm the signup upon submitting the verification code.
We have setup Amplify backend for this and we are able to send SMS to verified mobile numbers(with SNS mode as Sandbox). Now we wanted to move to production, so that we can send SMS to any phone number.
We created a support case to exit from SMS Sandbox and move to production. Support case has been approved and SNS console shows our account has production access now. However, Amplify Auth still shows SNS mode as Sandbox and we are unable to send SMS to unverified phone numbers.
Please note, we have registered with DLT in India and have valid Entity ID, Sender ID and Template ID. SNS Console clearly shows our account has production access and we are able to successfully send SMS from SNS console to any unverified phone numbers using our Sender ID, but with Amplify we are unable to send SMS.
While publishing SMS using SMS Console, we specify our Entity ID, Sender ID, Template ID and SMS is delivered successfully.
With Amplify, where do we specify these values to send SMS and how Cognito would map these values? Programatically all we do is, Auth.signUp(). Cognito User Pool have message Templates and Pinpoint captured Sender IDs, but no idea how/where these Message Templates are mapped to our Entity ID, Sender ID, Template ID. Without this mapping SMS won’t be sent obviously.
It would be good if there is a clear documentation from Amplify how to configure everything(Cognito/SNS/Pinpoint) to make this work. We are literally blocked moving to production on this, though functionality works fine in dev environment and all external aspects with DLT are taken care.
Expected behavior
SNS console clearly shows our account moved to production, but Amplify shows SNS mode as sandbox.
Expected behaviour: Amplify should SNS mode as production.
Amplify/Cognito fails to deliver SMS verification code when user signup with mobile number.
Expected behaviour: Should deliver SMS using our Entity ID, Sender ID and Template ID.
Amplify documentation is not clear where we need to capture Entity ID, Sender ID, Template ID and how they are mapped/used to send SMS.
Expection: Clear documentation from Amplify helps.
Reproduction steps
Create Amplify backend and add auth
Auth to have phone number based authentication
Users signup and Amplify/Cognito sends SMS verification code
Upon submitting the verification code, user account gets confirmed
(All of this works in dev env / sandbox mode)
Create a support case to exit from Sandbox
SNS console shows our account has production access now
In SNS console, use Publish SMS to send SMS using our Entity ID, Sender ID and Template ID
SMS gets delivered with our Sender ID
Now try User signup using Amplify and SMS won’t get delivered
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: