WeChat built-in Browser open Web page, get WeChat user OpenID

Source: Internet
Author: User
Tags openid
Browser access to user information is often seen, but how can the browser get the user information exactly how to achieve? This article will give you an explanation of the browser's access to user information.

I have opened a developer account for 300 yuan.
The requirements are as follows:
The existing WAP Web page, the user uses the built-in browser to open (through the friend Circle/friend sharing, or sweeps the Web page QR code and so on the way enters, has nothing to do with the public number), how this webpage obtains the user's OpenID?

According to the official login help, it is possible to implement the scan code login, but for the PC version of-scan code, computer-side login. And my situation is the current page is open on the phone, how to sweep code it?

I see some sites can be implemented, will pop up the authorization prompt box, but do not know how to achieve it? Thank you!!

Reply to discussion (solution)

Http://mp.weixin.qq.com/wiki/17/c0f37d5704f0b64713d5d2c37b468d75.html
Check this out

Built-in browser to get user's OpenID, public platform OAuth2.0 Web license
-----------------------------------------------------------------------------------------------
First of all, your website must be a service number (authentication, access to the user OpenID, subscription number is not).
Web page through the OAUTH2 certification link.

Then go to the website via 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

Write oauth2.php content according to the Oauth2 interface documentation provided, (the official SDK is available online)
Follow the steps below:
1. Get User OpenID
2. Get Accesson_token
3. Get user Information
4. Authorized registered user, if the user already exists, then go directly to the website.

Inside Open the Authorization prompt box appears, this is the public number of the landing
When the user clicks on the authorization, will jump to your page, the parameter inside will carry the token
Then you can call the interface via token, query OpenID, etc.

Some pages, open with an external browser will have the following tips, some do not, how to do it?

  • Related Article

    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.