Recently, I found a problem when I was doing company customization , Using wechat voice API Wechat report error when you're on the Internet , The error message is :the permission value is offline verifying

But the weird thing is : The same code in our company's products will not report this error , The interface can be called correctly . But on the client's server ,wx.config If the parameters in it are configured as the customer's wechat enterprise number, an error will be reported .

Discovery by query , WeChat JS-SDK The appendix 5 The possible causes of this problem have been explained

By checking , Find out 23 No problem , So focus on the first .

Through wechat web Debugging tool discovery wx.config Sure enough, the report was wrong , Error code invalid signature, It means the signature is wrong

Go to wechat again JS-SDK Check the error inside and find the following description

Through wechat WeChat JS Interface signature verification tool To verify , It is found that the result of the background calculation is consistent with that of the tool , The background algorithm is correct .

Then we focus on the parameters of generating signature

Because there was no problem in the company's products before , So we think the first three parameters are OK , Maybe the last one url There is a problem with the parameters , So through a search, we inquired about the following aspects .

1、 confirm url The page is complete url( Please on the current page alert(location.href.split('#')[0]) confirm ), Include 'http(s)://' part , as well as '?' hinder GET Parameters of the part , But does not include '#'hash Back section ,url It's dynamic .

2、 Go to the background of wechat enterprise number to confirm whether the trusted domain name is correct and in line with the rules .

result , We found that all the configurations were OK , There's no problem with the algorithm , But there are still mistakes , therefore bug The solution to the problem has come to a standstill .

So began to ask all kinds of questions , Look for , Asking in a group is a sentence from the great God “ Reverse proxy ”, Let the desperate situation have a ray of life , Background students said that our project is mapped to our company's server through reverse proxy .

therefore , Found through background debugging , Sure enough, the secret key was generated url A domain name is not a trusted domain name , It is the domain name set by the reverse proxy , So , The problem is finally solved .

Wechat enterprise No jsSDK wx.config newspaper invalid signature error , Lead to api Interface is not available for more related articles

  1. WeChat jsSDK Webpage prompts when developing official account numbers invalid signature The wrong solution

    WeChat official account development jsSDK, Link address cannot be added ? Parameters , Can pass # Pass parameters . Otherwise . page wx.ready() It's a mistake , use wx.error(function (res) { alert(" Interface validation ...

  2. Sharing interface of WeChat official account , Sharing tips config:fail,invalid signature Solutions for (2017 year 12 month )

    Open web page in wechat , Experience and summary of using the sharing function in the top right corner of wechat : In the beginning , When sharing the page on wechat , Read the title of the page directly (title) And the first eligible image on the page [ In this way 2017-03-29 It worked before , This day ...

  3. vue Single page (SPA) history Mode call wechat jssdk Occasionally after jump "invalid signature" Error resolution

    Project background vue-cli Generated single page project ,router Use history Pattern . Products will be used in official account. , Need to add wechat JSSDK, Do share related configuration . Problems encountered Related configuration and JS The interface security domain name has been changed ok, After the release of , ...

  4. Wechat sharing link appears config:invalid signature The wrong solution

    First of all, contribute jssdk Download address :  It's not recommended that you be in *SDN Spend money to buy points to download When developing wechat, we need to do specific page sharing ...

  5. Wechat enterprise No -JS-SDK Image interface

    Use JS-SDK Four steps are required   The main steps are step two and step three , Step 2 requires configuration , The third step is to use related interfaces , Here we take the image interface as an example php Page code is mainly used to complete step 2 , The configuration interface public function ...

  6. Wechat enterprise No JS-SDK: To upload pictures

    The WeChat JS-SDK Provides wechat client related functions , Such as : Taking pictures . Map selection . voice . Location and other mobile phone system capabilities , At the same time, wechat can be used directly to share . The unique ability of wechat such as scan , Provide better web experience for wechat users . Here's how to call JS ...

  7. Wechat enterprise No JS-SDK Select Picture 、 To upload pictures

    Because of the company's project needs , To modify a function of uploading pictures on a mobile phone , The original project used input Of file Control , Although the label can be multiple-choice , But in practice, only iOS Mobile phone can realize multiple choice ,Android Mobile phones don't support multiple choice , ...

  8. [ turn ] WeChat JSAPI Wechat built in JSAPI 2015 year 1 It's official this month API Interface , Share complete examples

    FROM : HTML Through WeChat , Share your circle of friends JSAPI <?php require_onc ...

  9. WeChat official account JSSDK Tips :invalid signature

    Deadly invalid signature. In fact, Tencent's documents have been written , I can only blame myself for my poor understanding , It fell several times . What is needed for signature jsapi_ticket What needs to be preserved ,2 Hours validity . If in 2 Problems occurred within hours and need to be deleted ...

Random recommendation

  1. LVS + KEEPAlived To configure DIR Pattern

    1 .1 Lvs LVS yes Linux Virtual Server Abbreviation , meaning Linux Virtual server , Is a virtual server cluster system . This project is in 1998 year 5 Founded by Dr. Zhang wensong , It is the first free software project in China ...

  2. [Android]Android Debug key Making

    Android Debug key Making background stay Android App Development process , We often use some third-party services , But many third-party services will ask us to provide the package name , Signature package , Now , In our daily debugging , ...

  3. About MSSQL Solution to the problem of primary key and constraint missing during import and export

    When importing data , Use default options , The primary key will be lost . constraint . Default value and other properties , Follow these steps : --> Export Wizard  --> Select data source  --> Choose the purpose  --> Specify table replication or query : Do not use default options , choice “ stay ...

  4. PHP in :: Use

    Access static variables , Static attribute ,const Decorated variable .

  5. Use of acoustic feedback suppression matlab/simulink Simulation

    My first job was to simulate howling suppression , turn up 0.3 There can be a big howl , Below SIMULINK simulation model There are many ways to realize phase shifting : 1.iir Realization  2.FFT Realization  3. Use FIR Realization All signals can be superimposed by sinusoidal signals .

  6. Use jdk The sort method provided in

    package com.bjpowernode.t01; import java.util.Arrays; /** * Use jdk The sort method provided in * */public class TestArray ...

  7. jmap Get the top memory objects

    docker Deploy ,jvvm adopt jmx The visit to fail , It can only be forever jdk Bring your own tools to check the situation : jmap -histo pid | sort -n -r -k 2 | head -10

  8. java Percentage calculation method

    As the saying goes, a good memory is better than a bad pen , So remember . DecimalFormat decimalFormat = new DecimalFormat("##.00%"); System.out.pri ...

  9. Spring transaction And EJB transaction The relationship between

    TransactionDefinition Interface that defines Spring-compliant transaction properties. Based on the p ...

  10. BarTender Can't connect to the database

    For various reasons , In the use of BarTender When connecting to the database , There may be problems that cannot be connected , The next part aims at two kinds of BarTender Unable to connect to the database , To teach you how to solve it . The first one is BarTender I don't have the right to open the text ...