froger-me/wp-weixin

Unable to log in WeChat

Closed this issue · 11 comments

When I turn on "Enable WeChat authentication" I am getting the error "Unable to log in WeChat - Authorized callback domain verification error. Error code: 10003" in H5. When I try to access the site through other browsers this does not appear.

Any idea what might be causing this? I presume it is a misconfiguration somewhere, but not really sure where to start.

The website address is https://www.manlaoriver.com and I have left the setting in tack if you would like to see the messgae for yourself.

Hello @MarcusCaeruleus, and thank you for the heads up.
I assume your domain is not registered in the WeChat backend.

To register the domain and authorize communication between it and the WeChat APIs (frontend JS and server side), you need a website with an ICP license, and then follow the steps below (roughly):

  • connect to the Official Account's backend
  • click "Interface Privilege" menu item
  • in the list, you search for "Web Page Authorization" and click the "Modify" link
  • add your domain in both "JS interface security domain name" and "Webpage authorization domain name" by clicking the "Set-up" link for both sections (add the protocol http or https only if explicitly asked) - make sure to include the MP_verify_[some_code].txt files to the root of your website as instructed, accessible publicly.

I know it is not explicitly stated on the plugin page, but this is the basic requirements for WeChat integration - my apology for this assumption. I plan to update the plugin to version 1.3.1 this week and add information regarding these requirements to the plugin page in the process.

Please let me know if it helped

I have added the instructions above to the README.md file. Please let me know if there is anything else I can do to help - if not, I will close the issue by the end of the week :).

@froger-me Thanks for the tip. It helped us along a bit, but we ended up finding out that because our official account was a "subscriber" account rather than a "service" account, we were limited in the kinds of functionaltity available. Setting up a new service account and following the process through seems to have resolved the issue nicely.

I have facing sem problem
https://tinyurl.com/ydxthedq

sem problem, sem solution ;).

Hello @MarcusCaeruleus, and thank you for the heads up.
I assume your domain is not registered in the WeChat backend.

To register the domain and authorize communication between it and the WeChat APIs (frontend JS and server side), you need a website with an ICP license, and then follow the steps below (roughly):

  • connect to the Official Account's backend
  • click "Interface Privilege" menu item
  • in the list, you search for "Web Page Authorization" and click the "Modify" link
  • add your domain in both "JS interface security domain name" and "Webpage authorization domain name" by clicking the "Set-up" link for both sections (add the protocol http or https only if explicitly asked) - make sure to include the MP_verify_[some_code].txt files to the root of your website as instructed, accessible publicly.

I know it is not explicitly stated on the plugin page, but this is the basic requirements for WeChat integration - my apology for this assumption. I plan to update the plugin to version 1.3.1 this week and add information regarding these requirements to the plugin page in the process.

Please let me know if it helped

i set like this, now my page repeat at request login many times... can help?

Hi @louisditho,

I would advise to check all the configuration again, in particular URL configurations, down to the protocol (http) to the www vs. non-www, permalinks, trailing slash, etc. This usually happens when the WeChat service does not recognize the page it need to return to after authentication as a valid page.

Without access to your settings, I cannot give more advice. If you need me to spend time troubleshooting your specific setup, I can do so for a fee.

Hi @froger-me
I've tried to set up "wep page authorization and JS API ..".
But I 've failed all.
I am not using china based on server. I mean I don't use china web server. I just use foreign server.
and I've already upload MP_verify_[some_code].txt file to root directory.
I hope you give me answer at your earliest convenient time.

Hi @FireflyStars
Chinese Law requires you to use a server hosted in China and a domain name with a valid ICP, because you are dealing with user personal information. WeChat requires that too, as they also have to comply with the law.

@froger-me Thanks for the tip. It helped us along a bit, but we ended up finding out that because our official account was a "subscriber" account rather than a "service" account, we were limited in the kinds of functionaltity available. Setting up a new service account and following the process through seems to have resolved the issue nicely.

好像订阅号通过认证以后也可以获得这些接口权限,我明天去认证我的订阅号试试。又要花300块。

It seems that after the subscription account gets verified, it can also obtain these API permissions. I'll go try to verify my subscription account tomorrow. It's going to cost another 300 yuan.

@froger-me Thanks for the tip. It helped us along a bit, but we ended up finding out that because our official account was a "subscriber" account rather than a "service" account, we were limited in the kinds of functionaltity available. Setting up a new service account and following the process through seems to have resolved the issue nicely.

好像订阅号通过认证以后也可以获得这些接口权限,我明天去认证我的订阅号试试。又要花300块。

It seems that after the subscription account gets verified, it can also obtain these API permissions. I'll go try to verify my subscription account tomorrow. It's going to cost another 300 yuan.

personal subscription account cannot be verified

What t f