Can I send 2FA token via email using Twilio's authy api? - twilio

I want to send 2-Factor Authentication token via email using Twilio's Authy api. I know Authy api offering Push Authentication, Soft token, SMS/Voice but is it also possible to send token via email?
If so, then can I register the user at authy without providing phone number and country code but just will give email address? Actually I only need to send token via email not over the phone.
Thanks.

Authy adds support for user authentication via email
https://www.twilio.com/changelog/authy-adds-support-user-authentication-email

Related

I can't seem to generate a simple authorization token in Twilio

What is the easiest way for a tenacious but stupid feeling new Twilio user to generate a simple authroization token so that I can send an API token Twilio from another app (REDCap) which I am using to send a one question SMS survey.
Does the trial account not allow me to generate an authorization token?
How quickly does the authorization token in Twilio expire?
Thanks in advance.
You don't generate your auth token, it's assigned to your account. It should be right in front of you when you first log in to your console.

Allow Azure AD app to send mails on behalf of only one specific user

I'm building a daemon service (no user interaction) which needs to send a mail via MS Graph. I've registered an app in Azure AD and given it the User.Read.All and Mail.Send application permissions and given admin consent for those.
In my Java code, I'm using the ClientSecretCredentialBuilder for authentication. By doing
graphServiceClient.users("johndoe#mytenant.com").sendMail(params).buildRequest().post();
I can send an email on behalf of John Doe. However, technically, I could send an email on behalf of any user in this tenant. Is there a way to configure the app so that it can only use a specific account to send mail from?
Graph API doesn't yet support such a feature.

How can I send OTP(One Time Password) from Firebase

I am new to Firebase and I am working on an iOS project in which I want to send OTP(One Time Password) to the email id given by a user.
Can I use below method to include any OTP? Or is there any method/way in firebase so that I can send an email with custom email body.
Note: I am not using any web service.
-(void)sendEmailVerificationWithCompletion:
(nullable FIRSendEmailVerificationCallback)completion
{
}
There is currently no way to change the message that is sent for an email verification or password reset request.
Firebase Authentication has no built-in support for one-time passwords or two-factor authentication. If you need those for your project, you can implement that with another provider and then mint a custom Firebase Authentication token for the user. You will need a server for that though, as minting this token requires use of your account credentials.
Through Firebase it is not possible except custom firebase authentication token mentioned above by Frank. Perhaps you should use your own database and from there you can send the OTP.

How to get userId from access token for Gmail OAuth2.0

What I'm trying to do
I'm trying to create a web app that would fetch emails from a user's Gmail. I understand that I would require authentication via Google OAuth 2.0.
What I'm trying to do is setting a watch() request on an inbox. Then, when the watched inbox gets an email, I want to get notified. I'm using Google's PubSub API.
What I've done
I followed the steps given in the Gmail OAuth documentation, but am confused as to how to store multiple access tokens for multiple users.
So when the user first logs in using their Gmail account, I generate a code which I exchange for an access token. Then I store this in a database. However, when I get notified about an email, I only receive from the API the user's email address. I would like to do some further API calls for this user. So now I would need to retrieve the token for the specific user. But...
The problem
... How do I store access tokens by email? I only have access to their token once they login/authorize. Is there any way of retrieving the email address from an access token? I could then store the access tokens as key-value pairs of <email address>-><access token>.
You can do a Users: getProfile-request immediataly as they log in for the first time, like so:
GET https://www.googleapis.com/gmail/v1/users/me/profile?access_token=<ACCESS_TOKEN_OF_THE_LOGGED_IN_USER>
Response:
{
"emailAddress": "example#gmail.com", // Here is the user's email address.
"messagesTotal": 6446,
"threadsTotal": 4495,
"historyId": "570232" // Here is the current historyId of his account.
}
Then, when you get a push request via watch(), you can use the historyId in the response above to see what has happened.

google oauth smtp access token for sending only

i am developing an app for sending emails via gmail smtp. Authentication is done via oauth... is there a way to authorize access to sending email only? and not checking inbox? that way if the access tokens and consumer tokens are somehow compromised, the hacker won't be able to actually read the user's inbox which is more serious issue than sending spams i guess.
No, the scope allows full access to SMTP, IMAP and POP.
Refer xoauth2_protocol oauth_20_scopes

Resources