To obtain the openid of WeChat users.

Source: Internet
Author: User
The web page opened in the built-in browser to get the user's openid. I have activated a developer account of 300 RMB.
The requirements are as follows:
Currently, a wap web page is opened in a built-in browser (via a circle of friends/friend sharing, or by scanning the QR code on the webpage, which is irrelevant to the public account). how does the Web page obtain the user's openid?

According to the official logon help, you can scan the code to log on to the PC version. In my situation, the current webpage is opened on the mobile phone. how can I scan the QR code?

I see some websites that can be implemented. an authorization prompt box will pop up, but I don't know how to implement it? Thank you !!


Reply to discussion (solution)

Http://mp.weixin.qq.com/wiki/17/c0f37d5704f0b64713d5d2c37b468d75.html
Look at this

The built-in browser obtains the user's openid, and the public platform OAuth2.0 web page Authorization
Bytes -----------------------------------------------------------------------------------------------
First, your website entry must be a service number (activate authentication and have the permission to obtain the user's openid; the subscription number cannot be used ).
The oau2authentication link on the webpage.

Then access the website through the service number menu link, such as: https://open.weixin.qq.com/connect/oauth2/authorize? Appid = YOURAPPID & redirect_uri = http: // YOUWEBSITE/oauth2.php & response_type = code & scope = snsapi_base & state = STATE # wechat_redirect

Compile oauth2.php content based on the provided oau2interface document (related official SDKs are available online)
Follow these steps:
1. obtain the user's openid
2. get accesson_token
3. get user information
4. authorize a registered user. if the user already exists, go to the website.


The http://huangqiqing123.iteye.com/blog/2005770 can refer to this.

The authorization prompt box appears. this is the logon of the public account.
When you click authorize, the user will jump to your page, and the parameter will contain the token
Then you can call the interface through token to query openid and so on.

The built-in browser obtains the user's openid, and the public platform OAuth2.0 web page Authorization
Bytes -----------------------------------------------------------------------------------------------
First, your website entry must be a service number (activate authentication and have the permission to obtain the user's openid; the subscription number cannot be used ).
The oau2authentication link on the webpage.

Then access the website through the service number menu link, such as: https://open.weixin.qq.com/connect/oauth2/authorize? Appid = YOURAPPID & redirect_uri = http: // YOUWEBSITE/oauth2.php & response_type = code & scope = snsapi_base & state = STATE # wechat_redirect

Compile oauth2.php content based on the provided oau2interface document (related official SDKs are available online)
Follow these steps:
1. obtain the user's openid
2. get accesson_token
3. get user information
4. authorize a registered user. if the user already exists, go to the website.


The http://huangqiqing123.iteye.com/blog/2005770 can refer to this.



If you have obtained the openid authentication in the built-in browser, you can enter the website (the built-in browser). If you click the upper right corner... open in the browser and jump out. Can I still get the user's openid to ensure the login status?

The built-in browser obtains the user's openid, and the public platform OAuth2.0 web page Authorization
Bytes -----------------------------------------------------------------------------------------------
First, your website entry must be a service number (activate authentication and have the permission to obtain the user's openid; the subscription number cannot be used ).
The oau2authentication link on the webpage.

Then access the website through the service number menu link, such as: https://open.weixin.qq.com/connect/oauth2/authorize? Appid = YOURAPPID & redirect_uri = http: // YOUWEBSITE/oauth2.php & response_type = code & scope = snsapi_base & state = STATE # wechat_redirect

Compile oauth2.php content based on the provided oau2interface document (related official SDKs are available online)
Follow these steps:
1. obtain the user's openid
2. get accesson_token
3. get user information
4. authorize a registered user. if the user already exists, go to the website.


The http://huangqiqing123.iteye.com/blog/2005770 can refer to this.




On some pages, the following prompt is displayed when you open them in an external browser. if some pages do not exist, how can this problem be solved?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.