Statement: The material used in this column is written by the VIP students of the Kay Academy, who has the right to be anonymous and has the final right to interpret the article; The Edith Academy is designed to promote students to learn from each other on the basis of public notes.
SMS Verification Code
SMS Verification code is to call some interface to send SMS, SMS verification code in the login, registration and other operations to use the most extensive, this section of this article demonstrates how to use Java to make a simple SMS verification code login.
I'm using a short message interface (not an ad) for aggregating data, because the interface invocation of aggregated data is convenient and simple, so first you need to go to the aggregation data to request a SMS interface API:
The application will require you to do real-name authentication, if you do not want to be certified to skip certification is also possible.
After applying for SMS API go to the following interface and click "Template":
You need to apply for a text message template, define the template content according to your own needs (before defining the template rule description below this page):
After you submit your review, you can see the audit status of the template list and template below this page:
Then click on "My Data" and click on "interface" in the SMS API service:
The invocation instructions for the interface are all in this page and need to follow the rules here to invoke the API:
After the SMS template application can use this API, the following shows how to use Java to invoke this API, make a simple SMS Verification code login: first, the page index.jsp code:
Class to invoke the SMS interface:
To process the servlet that sent the Authenticode request:
Finally, the servlet that handles the logon business:
Operation Result:
Verification Code Received:
Enter the verification code to sign in:
Console Print Content:
Java Implementation SMS Verification code