0

This is our use case:

  1. We have an ASP.NET MVC website in C#. When user goes to the login page, they enter their email and password.
  2. My C# code in the MVC action method checks the password against the database, and it is valid.
  3. My C# code sends a request to Twilio, and Twilio pushes a notification to a generic Twilio or third-party authentication app on the user’s mobile (note we don’t want to develop this app), which shows an “Approve” and “Deny” button.
  4. User presses the “Approve” button, and the response is returned by the app to Twilio.
  5. My code got notified, and logs user in.

Following is a diagram of the above process:

enter image description here

Can someone kindly point me to some documentation or sample code specifically for this use case please?

1 Answer 1

0

Twilio developer evangelist here.

The product you are looking for here is Twilio Authy Push authentication. It will push the notification to the Authy application when your user has it installed. You can also fallback to SMS or provide a QR code that allows users to use TOTP with their own choice of authenticator app.

You can check out the documentation on implementing Authy Push in C# in the Twilio docs.

Sign up to request clarification or add additional context in comments.

7 Comments

hi Phil, I executed the sample code at "twilio.com/docs/authy/api/users" to create a new user, and I got the following error: {"email":"is invalid","message":"User was not valid","success":false,"errors":{"email":"is invalid","message":"User was not valid"},"error_code":"60027"}
Did you try that with your own email or did you use the fake one in the documentation?
I used my own email and phone number, in the form of 61 as Australia's country code, and "411222333" as my mobile number. (my real phone number is different).
Ah, good news! I was a bit lost myself as to what to suggest next 😄
There is the Authy.NET library that will make requests and parse the results for you, but it is deprecated. Alternatively you could use Json.NET as suggested in this answer to parse the JSON yourself.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.