当前位置:网站首页>Wechat official account server configuration
Wechat official account server configuration
2022-06-25 16:44:00 【Aha】
Using the method provided by wechat official service, errors have been reported all the time
{errcode: -106, errmsg: "token check fail"}
errcode: -106
errmsg: "token check fail"Then I found a solution on the Internet
define("TOKEN", " It is set in the red box in the picture below token value ");
$echostr = $_GET["echostr"];
function checkSignature()
{
$signature = $_GET["signature"];
$timestamp = $_GET["timestamp"];
$nonce = $_GET["nonce"];
$token = TOKEN;
$tmpArr = array($token, $timestamp, $nonce);
sort($tmpArr, SORT_STRING);
$tmpStr = implode( $tmpArr );
$tmpStr = sha1( $tmpStr );
if( $tmpStr == $signature ){
return true;
}else{
return false;
}
}
if(checkSignature()){
echo $echostr;
}else{
echo " Authentication failed ";
} 

边栏推荐
- Bypass technology to talk about 'cross end'
- Preliminary understanding of JVM
- How to view the change trend of cloud database from the behind of the launch of tidb to Alibaba cloud
- JVM内存结构
- File operation, serialization, recursive copy
- 論文筆記:LBCF: A Large-Scale Budget-Constrained Causal Forest Algorithm
- Understanding of reflection part
- 解析数仓lazyagg查询重写优化
- This latest research has revealed two secrets of cloudy development
- WPF开发随笔收录-心电图曲线绘制
猜你喜欢
随机推荐
卡尔曼时间序列预测
error Parsing error: Unexpected reserved word ‘await‘.
mac php多版本管理以及安装swoole扩展
【蓝桥杯集训100题】scratch指令移动 蓝桥杯scratch比赛专项预测编程题 集训模拟练习题第14题
Built in function globals() locals()
心樓:華為運動健康的七年築造之旅
Generate post order traversal according to pre order traversal and mid order traversal
MySQL_ JDBC
Summary of 2022 spring moves of ordinary people (Alibaba and Tencent offer)
Alvaria announces Jeff cotten, a veteran of the customer experience industry, as its new CEO
What can one line of code do?
Resolve the format conflict between formatted document and eslint
AD域登录验证
Detailed explanation of IVX low code platform series -- Overview (I)
微信公众号服务器配置
Go language - what is critical resource security?
Day_ 05
The third day of mysql45
论文笔记:Generalized Random Forests
User login 2









