Android Question verify sms secure

alireza1238

Member
Hello to all !
I create app with b4a
I have signup page with phone number and confirm with verification code in my app
How can I prevent spam?
I want it to be a restriction that will be blocked for a day after testing and sending the user's SMS several times
I'm afraid a hacker will disrupt my app
i use post request method for send data to server
 

FrostCodes

Active Member
Licensed User
Hi, I think you can place a ban on multiple trials from a number 10 times in a day and I would suggest that you allow only a resend of a new OTP or verification code first for 5 minutes then you double it by x2 eg 5 ... 10...20...40..60 minutes at least this is probably almost how I would go about such.
You need a database to track this also.

Just my idea :)
 
Upvote 0

alireza1238

Member
My code:
Sub Globals
    Dim ht As HttpJob
    Private btnSubmit As Button
    Private shomare As EditText
    Private vercode As EditText
    Dim code As String = 0
    Private sendsms As Button
    Private codename As Label
    Private pnlcode As Panel
End Sub

Sub Activity_Create(FirstTime As Boolean)
    
    Activity.LoadLayout("lRegisteration")
    shomare.Color = Colors.Transparent
    vercode.Color = Colors.Transparent
    ht.Initialize("register",Me)
    
End Sub

Sub jobdone (job As HttpJob)
    
    If job.Success Then
        Log(job.GetString)
        code = job.GetString
        codename.Visible = True
        pnlcode.Visible= True
        vercode.Visible= True
        btnSubmit.Visible = True
    Else
        ToastMessageShow("Enternet Error",True)
    End If
    
End Sub

Sub sendsms_Click
    
    If shomare.Text.Length =11 Then
        
'        ht.poststring(link,"num="&shomare.Text)
        codename.Visible = True
        pnlcode.Visible= True
        vercode.Visible= True
        btnSubmit.Visible = True
    Else
        Msgbox("The phone number must be 11 digits","Warning")
    End If
    
End Sub

Sub btnSubmit_Click
    
    If vercode.Text <> "" Then
        If vercode.Text = code Then
            ToastMessageShow("Success login!",True)
            code = ""
            StartActivity(addorder)
            Activity.Finish
        Else
            ToastMessageShow("False code",True)
        End If
    Else
        Msgbox("Enter Your Confirmation Code?","Warning")
    End If
    
End Sub

Sub Activity_Resume
    
End Sub

Sub Activity_Pause (UserClosed As Boolean)
    
End Sub
 
Upvote 0
Top