Play 版本微信(6.6.1)现在公众号网页授权的跳转是怎样的了?

2018-01-26 17:38:54 +08:00
 alex321
今天发现一个现象,按照微信官方文档: https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421140842

#第一步:用户同意授权,获取 code
假设我有 https://example.com/getUser.html 的页面跳转获取用户授权的 code: https://open.weixin.qq.com/connect/oauth2/authorize?appid=APPID&redirect_uri=REDIRECT_URI&response_type=code&scope=SCOPE&state=STATE#wechat_redirect

那么,相应 scope 为 snsapi_base 的模式下就是: https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx520c15f417810387&redirect_uri=https%3A%2F%2Fexample.com%2FgetUser.html&response_type=code&scope=snsapi_base&state=123#wechat_redirect
scope 为 snsapi_userinfo 模式下就是: https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxf0e81c3bee622d60&redirect_uri=https%3A%2F%2Fexample.com%2FgetUser.html&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect

实测我在 Play 版本的微信(6.6.1)上扫码进入,通过 Fiddler 观察,微信打开了 https://example.com/getUser.html
scope 为 snsapi_userinfo 模式的时候并不是进入到微信官方文档的那个用户授权页面 https://i.loli.net/2018/01/26/5a6af53c4d6b5.jpg
而是一个弹层,选择授权或拒绝。Fiddler 已经开启 https 远程捕获并在手机上安装了 Root 证书。

选择授权时,成功通过 code 换取到 access_token,并利用 access_token 和 openid 取到用户信息;选择拒绝时,页面未作跳转,依旧停留在 https://example.com/getUser.html

所以,现在公众号网页授权的跳转是怎样的了?
783 次点击
所在节点    问与答
0 条回复

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/426227

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX