Explanation of the implementation of snsapi_base, snsapi_userinfo and silent authorization in WeChat development, and the silent authorization of snsapibase

Source: Internet
Author: User

Describes the implementation of snsapi_base, snsapi_userinfo, and silent authorization in the development process.

Implementation of snsapi_base, snsapi_userinfo and silent authorization in development

Snsapi_base and snsapi_userinfo are two scopes for Obtaining user information through webpage authorization.

Snsapi_base can only obtain access_token and openID

Snsapi_userinfo can be used to obtain more detailed user information, such as profile pictures, nicknames, and gender.

First, the access_token here is different from the basic access_token (for example, used in a custom menu. The differences are as follows:

The webpage-authorized access_token is updated together each time the openID is obtained. The interface call frequency limit is "unlimited"

The basic access_token is generally limited to 2000 times/day. You need to save it and update it regularly.

Second, when the scope is snsapi_userinfo, according to the instructions in the official documentation, the user needs to click authorization. However, I found that there is a way to obtain it silently without clicking authorization. The method is as follows:

1. Use snsapi_base to obtain both access_token and openid

2. Use access_token and openid here for the https://api.weixin.qq.com/sns/userinfo? Access_token = ACCESS_TOKEN & openid = OPENID & lang = zh_CN

3. After the request is successful, the user details are obtained silently.

The premise of the above method is that the user pays attention to the same public account. If you borrow other public accounts, you need to click authorize.

Thank you for reading this article. I hope it will help you. Thank you for your support for this site!

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.