Coder Social home page Coder Social logo

微信公众平台接入 about weixin-popular HOT 4 CLOSED

liyiorg avatar liyiorg commented on August 23, 2024
微信公众平台接入

from weixin-popular.

Comments (4)

liyiorg avatar liyiorg commented on August 23, 2024

是一样的

from weixin-popular.

yangqinglei26 avatar yangqinglei26 commented on August 23, 2024
 //首次请求申请验证,返回echostr
        if(echostr!=null){
            outputStreamWrite(outputStream,echostr);
            return;
        }

        //验证请求签名
        if(!signature.equals(SignatureUtil.generateEventMessageSignature(token,timestamp,nonce))){
            System.out.println("The request signature is invalid");
            return;
        }

应该先验证签名确认它是来源于微信的请求,再返回echostr

from weixin-popular.

liyiorg avatar liyiorg commented on August 23, 2024

只有配置完后的第一次请求会有 echostr 参数数据, 不管是微信官方或非法请求,有这个字段都直接返回,并不影响之后请求的签名校验以及安全性。如对安全性要求比较高的话,使用加密配置,参考 ReceiveServlet2 。

from weixin-popular.

linzea avatar linzea commented on August 23, 2024

哈哈哈,我就用的这个啊,没问题,而且我选的是加密那种,微信后台加密模式选了兼容模式

from weixin-popular.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.