SMS Verification Code implementation process

Source: Internet
Author: User
Tags json

1, constructs the mobile phone verification code: uses the Random object to generate the required stochastic number as the verification code, for example 4-bit verification code: 1000~9999 between the random number;

2, the use of the interface to the SMS platform to send mobile phone number and verification code data, and then the SMS platform to send verification code to the development of mobile phone number, interface parameters generally include: The target mobile phone number, random verification code (or contain failure time), platform interface address, platform password;

3, save the information returned by the interface (generally JSON text data, and then need to convert to JSON object format);

4, the mobile phone number-verification code, operation time into the session, as the latter to verify the use;

5, receive the user to fill in the verification code and other data;

6, compare the verification code submitted with the session of the verification code is consistent, and determine whether the submission action is within the validity period;

7, the verification code is correct and within the validity period, the request passes, handles the corresponding business.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.