Golang implementation of Weixin access authentication interface

Source: Internet
Author: User
This is a creation in Article, where the information may have evolved or changed.

Great, Golang is also very good, I have a small plan, used to control our smart home panel switch and so on. Just also in learning Golang, take it to practice practiced hand.

Specifies that the access interface must be 80 port HTTP service, each to the public account of the message, the platform will be post to the agreed interface, the URL is as follows

Http://www.wadahana.com/weixin.goapp?signature=41a1e2aec5e0bb6b8686ee361e5b305cf5c04f13&echostr= 1000737891698810841&timestamp=1407852505&nonce=1183067877

The signature check we need to do is simply to sort the timestamp,nonce and tokens that are submitted on the Weixin platform, and then stitch them together and take them directly to Sha, if they are equal to signature, It indicates that the POST request is dropped by the platform, not equal, do not know which puppy to come, verify the success, the content of the ECHOSTR to the platform intact.

Then we'll just have to go to the code.




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.