Official document
It is best to be familiar with the above documents first
text:
Step 1️⃣: Homepage=》Management Center=》Third-party platform=》Create a third-party platform
Step 2️⃣: Enter the basic information = "Enter the information filling page = "The platform type depends on what you need, and the specific difference documents have detailed instructions
Step 3️⃣: Choose permissions, tick them according to your needs, tick them all if you don't understand them. . . That’s how I did the first operation
Step 4️⃣: Fill in the development information. Note that the stuff on this page is very important, and has a very important relationship with the interface docking later. If there is no domain name, you can do an intranet penetration. I use Natapp . You can refer to this one-minute tutorial for beginners to solve the domain name problem perfectly. It is recommended not to use free, free temporary domain names are easy to switch;
Step 4: Explanation of the terms filled in the development materials:
Authorization initiation page domain name: You must jump to the login authorization page from the web page within this domain name to complete the login authorization. No need to fill in the domain name protocol prefix such as http://. For local development, just write the domain name penetrated by your intranet.
List of authorized test official accounts: Before the entire network is released, only official accounts in this list can be authorized for testing. Please fill in the original ID of the official account (which can be found on the official account setting page of the official platform website), up to 10, separated by English ";".
Authorization event receiving URL: used to receive cancellation of authorization notification, authorization success notification, authorization update notification, and also used to receive tickets. Tickets are important credentials to verify the platform; Note: After the third-party platform is created and approved, the WeChat server will send Its "authorized event receiving URL" regularly pushes component_verify_ticket every 10 minutes. The third-party platform also needs to decrypt after receiving the ticket push (for details, please refer to the [Message Encryption and Decryption Access Guidelines]), and it must directly return the string success after receiving it. code show as below:
Need to download WeChat decryption tools
/**
* 接收ticket
*/
@RequestMapping("ticket")
public String ticket(HttpServletRequest request) throws Exception {
log.info("接收ticket==================》开始");
String msgSignature = request.getParameter("msg_signature");
String timeStamp = request.getParameter("timestamp");
String nonce = request.getParameter("nonce");
log.info("开始接受postdata---" + request.getInputStream());
BufferedReader br = new BufferedReader(new InputStreamReader(request.getInputStream()));
StringBuffer sb = new StringBuffer();
String line = null;
while ((line = br.readLine()) != null) {
sb = sb.append(line);
}
String postData = sb.toString();
log.info(msgSignature + "==============》" + timeStamp + "==============》" + nonce + "==============》" + postData);
WXBizMsgCrypt pc = new WXBizMsgCrypt(WeiXinConstant.TOKEN, WeiXinConstant.ENCODING_AESKEY, WeiXinConstant.APP_ID);
String result = pc.decryptMsg(msgSignature, timeStamp, nonce, postData);
//appId 第三方平台APPid;
// InfoType component_verify_ticket;
// ComponentVerifyTicket Ticket内容
log.info(result + ".................");
return "success";
}