oauthwechat

WeChat open platform openId and unionId


I want to implement the login with WeChat. While reading the documentation, I came across two different parameters whose meaning I don't fully understand: openId and unionId.

Could someone explain what these id's really are? As far as I understood it should be like this:

The documentation I read can be found here: http://open.wechat.com/cgi-bin/newreadtemplate?t=overseas_open/docs/web/login/getting-user-profile#login_getting-user-profile


Solution

  • From my understanding, a user's open ids vary from web apps to apps, whereas union id stays the same. For example, you have two apps that use wechat login: W1 and W2. A user will have openid1 for W1 and oepnid2 for W2 seperately, but you can use the user's union id the uniquely identify him/her across the apps.

    Open id only changes when you have more than one web/mobile apps.

    Hope it helps. Thanks.