search
HomeWeChat AppletWeChat DevelopmentHow to implement snsapi_base, snsapi_userinfo and silent authorization in WeChat development

This article mainly introduces relevant information on the implementation of snsapi_base, snsapi_userinfo and silent authorization in WeChat development. Friends in need can refer to

Detailed explanation of snsapi_base, snsapi_userinfo and silent authorization in WeChat development. The implementation

snsapi_base and snsapi_userinfo belong to the two scopes of WeChat webpage authorization to obtain user information

snsapi_base can only obtain access_token and openID

snsapi_userinfo can obtain more detailed user information, such as avatar, nickname, gender, etc.

First of all, the access_token here is different from the basic access_token (such as used in custom menus). The difference between the two is as follows:

The access_token authorized by the web page is updated together every time the openID is obtained, and the interface call frequency limit is "unlimited"

The basic access_token is generally limited to 2000 times/day, you need to save it yourself and update it regularly

Secondly, when the scope is snsapi_userinfo, according to the instructions in the official document, the user needs to click to authorize, but I found that there is a way Obtained silently without requiring click authorization. The method is as follows:

1. Through snsapi_base, obtain access_token and openid at the same time

2. Use the access_token and openid here for the http://www.php.cn/ interface

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

The premise of the above method is that users in the same public account follow it. If it is borrowed from another official account, the user needs to click to authorize it.

Thank you for reading, I hope it can help you, thank you for your support of this site!

The above is the detailed content of How to implement snsapi_base, snsapi_userinfo and silent authorization in WeChat development. For more information, please follow other related articles on the PHP Chinese website!

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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft