How can I use cognito to create user accounts, but a different service for verification? - node.js

I am building an app that will be using Plivo or Twilio for user interaction and input.
I wanted to use AWS Cognito for user management, but for verification, they say a user must verify email or phone number.
I wanted to have the user interaction and verification come from the same phone number, so is there a way to set this up in Node.js somehow, where a text to a Plivo/Twilio number reroutes to AWS Cognito for verification?

Looking at the document, it seems that it is now possible to send emails and SMS using a third party.
It is unknown when it was released.
Custom Sender Lambda Trigger
https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-custom-sender-triggers.html
Custom SMS Sender Lambda Trigger
https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-custom-sms-sender.html
Custom Email Lambda Trigger
https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-custom-email-sender.html

You can leverage the custom auth flow to achieve this. Take a look on a example article we have here:
https://aws.amazon.com/blogs/mobile/customizing-your-user-pool-authentication-flow/
The idea is that you will explicitly do the calls you want to Twilio/Plivo from the lambda function.
Cognito UserPools does not intergrade out of the box with a third party.
And offers its own notification mechanism through SNS and SES services.
I would consider this option as well in your position.

Related

How to link firebase phone and email authentication for web? [duplicate]

I am developing an app wherein the users use either email and phone to perform registration.
Users can enter their email or phone for log in, I want the same OTP to be sent to mobile and email simultaneously. Please Help!
If you want to work only with Firebase Authentication, then there is not any suitable solution that meets your requirement.
Some limitations you can find with Firebase are Firebase Authentication Limits and Phone number sign-in limits.
However the alternative solution is using third-party SMS gateway. through with you can send OTP to phone number as well as to email also simultaneously.
Lets assume you already have mechanism to generate OTP and verify OTP from android app.
Now the problem is how to send OTP to the user's email.
One of solution is using MailGun service to send email from your backend.
Also, if you want to templating your email, you can use library called handlebar

Send notification to one user with firebase cloud function node

I am trying to send a notification to a specific user using FCM, but I haven't found a way. I have a mobile app and a node server running.
I want to be able to send a notification when the shipment status changes. I have already a function for it in my server I just have to send the notification to the user. Is it possible to achieve this using nodejs or is there a way to implement it in flutter?
I found this code
    var FCM = require('fcm-node')
var serverKey = require('path/to/privatekey.json') //put the generated private key path here            
var fcm = new FCM(serverKey)     
var message = { //this may vary according to the message type (single recipient, multicast, topic, et cetera)        
to: 'registration_token',         
collapse_key: 'your_collapse_key',                
notification: {            
title: 'Title of your push notification',             
body: 'Body of your push notification'         
},                
data: {  //you can send only notification or only data(or include both)            
my_key: 'my value',            
my_another_key: 'my another value'        
}    
}        
fcm.send(message, function(err, response){        
if (err) {            
console.log("Something has gone wrong!")        
} else {            
console.log("Successfully sent with response: ", response)        
this is a npm package taht lets send a notification but it asks for a registration token.
I hope you can help me. Thanks in advance!
Firebase Cloud Messaging has no concept of a user. Instead it can send messages to:
Specific app instances (so your specific app as installed on one specific device), as identified by an FCM/device token.
A group of app instances/tokens, as defined by your application logic.
A specific topic, to which app instances can then subscribe.
It's up to your application logic to decide how to map from your user ID to one of these options. The most common are to:
Store the device token(s) and your user ID in your own database, then look up the device token(s) for a user when needed and fill them in to the API call you already have.
Use a specific topic for each user ID, subscribe the application to that when it starts, and then send a message to that topic when needed. Note that anyone can subscribe to any topic though, so this approach would allow folks to receive message for anyone whose user ID they know.

Custom Policy SMS Message

I have a custom policy with MFA using PhoneFactor, it works however, the SMS sent says
123456
Use this code for Custom Policy Manage verification
Is there anyway to change the
Use this code for Custom Policy Manage verification
to be different text? Say
Use this code for X Application verification
Currently it is not possible to customize the SMS content.
You can raise user voice for your request in Azure feedback portal or vote for the existing one

How to send information from an app to another e-mail without using e-mail?

I am programming a quiz-app where the player should have the possibility to sent his own questions to a customer feedback email address with his own question suggestions. The question I have now, is it possible to sent the data that the user types in the EditText fields to an E-mail address without using the address of the player?
I presume you will have a server and REST API for authentication, serve quiz questions, verify answer etc.
Add one more REST API to above list to accept feedback. Your Android App should capture data from text field, and call REST API just like it would have called any other API. REST API can derive user information from an auth token. REST API on server can use third party email service eg. Sendgrid or AWS SES to eventually send an email to target email address.
If you are not performing user authentication, Android application can optionally send some additional information about user to the REST API.
If you are not using server itself, then you will have to consider using a server and maintain your own REST API, or opt for server-less architecture e.g. AWS Lambda.
In any case, you shall consider using one of the third party email service rather than setting your own email setup.

Can gmail (smtp.gmail.com) post incoming mails to my application instead of my applications pulls the mail?

I am using smtp.gmail.com to send mails.
I want to read/parse mails in my application.
I know how to pull the mails, there are API libraries to handle that. It is bit over do for my application.
Instead, is there any way gmail can post mails to my application like sendgrid does ?
If you want to get emails from a gmail account, and want a webhook to do such, you could use Context.io's Webhook Feature.
However, at the maximum volume you'll be able to send out with Gmail, I'd recommend looking toward an email service provider's free plan. If you're familiar with SendGrid already SendGrid's Free Plan will give you access to both low volume sending, and the Parse webhook. Other email service providers will give you the same functionality on their free plans, as well (e.g. Mailgun).
Disclaimer: I am a SendGrid employee.

Resources