Home  >  Article  >  Backend Development  >  If the WeChat subscription account gets the openId (except when users send messages and focus)

If the WeChat subscription account gets the openId (except when users send messages and focus)

WBOY
WBOYOriginal
2016-12-01 00:25:441600browse

If the WeChat subscription account obtains the openId, some say that it can be authorized using the oauth2 of the service account, and some say that the unionid mechanism can be used. How to implement these two specifically, please provide the source code.

Reply content:

If the WeChat subscription account obtains the openId, some say that it can be authorized using the oauth2 of the service account, and some say that the unionid mechanism can be used. How to implement these two, please provide the source code.

Web page authorization to obtain basic user information:
https://mp.weixin.qq.com/wiki...

If you use the method you described, you need to have a subscription account and a service account, and then bind the two accounts on the open platform
If the WeChat subscription account gets the openId (except when users send messages and focus)
You can directly obtain the openID through the service account, because the same user has two accounts bound to each other. The openID in the subscription account and the service account are the same

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn