Skip to content

Fetch user info #27

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 5, 2020
Merged

Fetch user info #27

merged 2 commits into from
Jun 5, 2020

Conversation

ChrisBr
Copy link
Contributor

@ChrisBr ChrisBr commented Jun 4, 2020

No description provided.

@ChrisBr ChrisBr marked this pull request as ready for review June 4, 2020 15:57
@ChrisBr ChrisBr closed this Jun 5, 2020
@ChrisBr ChrisBr reopened this Jun 5, 2020
@Eric-Guo Eric-Guo merged commit 64905b7 into NeverMin:master Jun 5, 2020
@ChrisBr
Copy link
Contributor Author

ChrisBr commented Jun 5, 2020

Thanks for the quick merge @Eric-Guo

@Eric-Guo
Copy link
Collaborator

Eric-Guo commented Jun 5, 2020

Thank you for contribution, will testing first and if no problem will do a release in 2 days and have a nice weekend.

@ChrisBr
Copy link
Contributor Author

ChrisBr commented Jun 5, 2020

Thanks 👍

I will prepare a PR to remove the logging again, it was just intended for debugging, sorry about that. I think we should not log the access token in production.

Also I was wondering if we should change to use the union id instead of the open id as uid.

OpenID is an unique encrypted WeChat ID for each user of an OA (including Mini Program). Users have separate OpenIDs corresponding to different OAs. In Developer Mode, when subscribed users interact with an OA, the developer can obtain their OpenIDs and use it to get basic user information (gender, photo, location etc.)

UnionID is an unique ID to identify a single user under the same WeChat open platform account. If a developer possesses multiple mobile applications, website applications, and OAs (including Mini Programs), they can use a UnionID to differentiate the uniqueness of users. In other words, UnionID offers a mechanism for developers to acquire a user’s data from multiple platforms and attribute actions back to the specific user.

Unlike the open id, the union id is stable. In our use case for instance, we have different WeChat applications for web, android and iOS but if you register on iOS you should also be able to login on web or android. I think this is the case for most users of this gem. Would you be open for a change too?

https://wiredcraft.com/blog/wechat-for-dummies-user-data-and-authorization/
https://stackoverflow.com/questions/40044572/wechat-open-platform-openid-and-unionid

@ChrisBr ChrisBr mentioned this pull request Jun 5, 2020
@ChrisBr
Copy link
Contributor Author

ChrisBr commented Jun 5, 2020

Remove logging #28.

The only problem with the OpenId -> UnionId change might be backward compatibility 🤔

@Eric-Guo
Copy link
Collaborator

Eric-Guo commented Jun 5, 2020

Sorry, I just only have a quick glance instead of reading it, although I already read it this morning.

I'm OK to use the union id, but I guess not every WeChat program needs union id (at least I have one at hand no union id yet), anyway, I agree every WeChat program will eventually reach to using the union id at some point.

You can continue to propose PR and ping me if you believe it's ready, thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants