OpenFlutter / OpenFlutter/fluwx

WeChatAuthResponse should expose openid / provide built-in userinfo exchange

Open
#772 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Dart
Stars
3.3k
Forks
553
PR merge metrics
No merged PRs in 30d

Description

fluwx 的 WeChatAuthResponse 目前只返回 code、state、type、country、lang,缺少 openid(以及可选的 unionid)。

这导致开发者必须自己在客户端调微信 REST API /sns/oauth2/access_token + /sns/userinfo 来获取用户信息,但 /sns/userinfo 已在 2021 年被微信废弃,返回的 nickname 是加密占位符,无法获取真实昵称。

而微信原生 SDK (SendAuth.Resp) 在较新版本中已经能直接返回 openid。如果 fluwx 能把这个字段透传出来,至少可以省掉一次 code 交换的 HTTP 请求,让开发者把用户信息获取交给自己的后端处理。

建议:

  1. WeChatAuthResponse 增加 openid 字段(来自原生 SDK 回调)
  2. 或者提供一个内置的 code 交换方法,走服务端代理而非废弃的 /sns/userinfo

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating WeChatAuthResponse and the native SendAuth.Resp callback mapping in fluwx. Check how callback fields are transferred and whether openid or unionid is available there; done means the supported response exposes the requested identity field, or the issue's chosen server-side exchange approach is clearly defined.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, flutter
Domain
authentication, mobile
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.