Dotnet MAUI SMS OTP Generation using Twilio

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
let's try to generate OTP from our.net Maui app and we'll be using too low as our server to generate OTP and which can be usable for our OTP verification to in our DOT net Maui app so our first and foremost step is to register to this site during the time of registration it will ask for your phone number so try to give your valid phone number and then you will get a verification code if you are a valid user then here you can see I have to add what do you plan to build with twilo so here I'll just tell other and then which product are are you here to use and here I'm going to use the SMS only with code so we'll be selecting with code section and then what is your preferred language then we'll be using the CSUB for sure no I want to host my own uh from our service that is like I don't want to stay from twilo anything okay so at first and foremost we'll see this uh website uh and it will ask me to generate a phone number so this phone number is uh the from phone number that is uh usable for uh sending the SMS to the uh two phone numbers that means this is from N2 and from from then we'll be using this server phone number so I will be creating a brand new.net Maui app at first so at first we'll be removing the button code over here and then here I'll just change the button text to send me then I'll be removing this line of code and then here we'll be changing our level to entry and giving the X name to two phone number so I have already mentioned you about from N2 phone number so to phone number dot text this is the entry so we'll be extracting out the text so in order to extract out the text we'll be using a variable name as string and two phone number so two phone number is the phone number that will be sending the SMS notification too okay so at first uh then we have to use our uh supporting documents from the twilo so here you can see we have document and support section so we'll be going to developer uh docs then here we'll be selecting the SMS because we want the SMS feature uh that is our OTP generation so when clicking on send your forced to post SMS then you will get uh this section where we'll be selecting the sisa so actually we need to just copy this line of code that is that is it okay so we'll be pasting the code code over here and we'll be replacing uh it uh with the two phone number that will be uh generating from our mobile UI so it requires uh our twilio plugin at first so we'll be adding twilio plugin uh that is this plugin that is tutorial rest API Apple Library so this all the plugin Integrations has to be done on the asp.net core uh web API so in the web API project we'll be adding all the ssids and authentication token code so don't add it over here just for this demo I'm adding the authentication Sid and over here to make this demo faster and to make it work also so here uh two low client will get inherited from these two namespaces so watch it out we have other namespace too so here we'll be using these two namespaces uh from the twilo and then here we'll be adding our odd token uh from our server side that is our twilo website so here I'll just uh get the auth code from here so I'll hide this code because this is my private auth code and we'll be changing it to the Android Android phone so here I'll be running the whole project on the Android phone and let's see whether we get some type of text or not so here we'll be entering the phone number that we have used during the time of registration to Twitter that is our private number so this number is a valid number so along with the plus extension sign so this is my mobile number and then I'm just going to see whether it keeps a successful output or not so let's see let's wait so yeah uh it's successfully ran the code and we got the message too and if your account is valid then you will see uh such type of messages and along with the uh date Creations items too over here you can see I got the notification that is something like a uh let me go back so here hi there uh this is the uh twilio of trial account and and I'm sending a message hi there okay so if you have a valid account that means if you have a paid account then this sent you from your toolo trial account or message won't be seen because uh right now we are in pre-account that's why we are seeing it now our next work is to uh copy and paste uh the pre-written code that have uh written for uh generating the OTP and which will be useful for whenever you are creating uh the OTP verification apps so I'll be copy and pasting over here okay so I'll be giving this whole code on my videos description below you can just uh uh like take it from there and this is how we generate the OTP for the verification you can just uh create another button and then when clicking on it then you can verify whether the uh the OTP that was sent from the uh server and the OTP that was uh sent from The Client app are same or not if it is valid then you can navigate to a home page okay so here I have entered this OTP so uh from the server we get a OTP that your OTP is something like this and you will weld it on your mobile app that's all
Info
Channel: Xamarin Guy
Views: 913
Rating: undefined out of 5
Keywords: #DotnetMAUI #Xamarin #XamarinForms #Dotnet
Id: I6mFmbYgvI4
Channel Id: undefined
Length: 6min 21sec (381 seconds)
Published: Mon Jul 03 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.