Website to explain

OpenID

User unique identification. Please note that when a user visits the website of the official account without paying attention to the official account, an OpenID unique to the user and the official account will also be generated

UnionID

By obtaining user basic information interface, developers can obtain user basic information through OpenID, and if developers have multiple official accounts, they can use the following methods to communicate user accounts among multiple official accounts through UnionID mechanism. As long as it is the same WeChat open platform account under the public number, the user’s UnionID is unique. In other words, the UnionID for the same user will be the same for different applications under the same WeChat open platform account.

Understand the way

WeChat ID

Assuming that WeChat ID is our unique identifier as A WeChat user, then user A’s WeChat ID is _1232sdasf, and user B’s WeChat ID is helloBBBBB, then when we get user WeChat, WeChat will definitely not return us the specific WeChat ID, right? Why not? If return WeChat ID, then we can add many, many, many people according to WeChat ID ~~~ think WeChat ID fell into the hands of scheming people, it is a terrible thing…. So, in the user authorization information, there is no reference to WeChat ID information. So how do you identify the user? Please continue to look down down down down down down

OpenID

When applying for public number and small program, there is an APPID, which is the identification of the current account. There is also an AppSerect for decrypting data. OpenID is the identity of the user on a public platform.

OpenID = User WeChat ID & Public Platform APPID (two data encrypted strings)

For example, 🌰 Xiaoming WeChat ID is T1928738SS, the public account A is A mall, and the public account B is B mall. If you enter Mall A at this time, the OpenID of Xiaoming obtained by Mall A is 33487793847837734; if you enter Mall B at this time, the OpenID of Xiaoming obtained by Mall B is 48423948753248900. Xiaoming has different identities between mall A and B, and the identity is unique, that is to say, in A public account, no matter how many times he enters it, it is still an OpenID. Similarly, Xiaoming enters the applet C, applet D, public account F… In each of these systems, the OpenID obtained in the background is actually different. Then, if a merchant wants to set up a mall on the public account and a mall on the small program side, two different OpenIDs will be generated after Xiaoming enters the store, won’t there be two Xiaoming users? Isn’t that strange… Simply imagine, you from the public number into a web version of the Pelling Xi Xi mall, account has 10 of the Pelling beans, but into the small program version of the Pelling Xi Xi mall, account only 1 of the Pelling beans, is not very lost? Who imitated my handsome….. So in order to prevent such a “weird” phenomenon, we have to solve the problem is: how to determine the Xiaoming this person in the “same” mall, is the “same” user? Please continue to look down down down down down down

UnionID

Let’s start with the concept of an open platform

WeChat open platform serves as an interface for third-party mobile programs, enabling users to publish the contents of third-party programs to friends or share them in the circle of friends, and third-party content can be more widely disseminated with the help of WeChat platform. Thus formed a mainstream online and offline WeChat interactive marketing way.

Combined with the UnionID explanation

The UnionID mechanism provides the following information: If a developer has multiple mobile applications, web applications and public accounts, the UnionID of the user’s basic information can be obtained to distinguish the uniqueness of the user, because the UnionID of the same user is the same for different applications (mobile applications, web applications and public accounts) under the same WeChat open platform.

There are many functions of the open platform, but our goal today is to connect the public number and small programs in the same open platform. When applying for the open platform, we also get the AppID and AppSerect of this open platform.

UnionID = User WeChat ID & Open Platform AppID (two data encrypted strings)

After connecting the official account and the applet in the same open platform, no matter Xiao Ming enters from the applet or the official account, he will get the OpenID and UnionID from the background information. The OpenID is different and the UnionID is the same. Through the UnionID, he can be clearly known as Xiao Ming.

conclusion

  • OpenID is the user ID obtained after WeChat ID is encrypted with AppID of the public platform.
  • UnionID is the unique user identity obtained after WeChat ID and AppID of open platform are encrypted. The premise is that each public platform needs to be bound to the same open platform before the same UnionID can be obtained from each platform.