V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
alex321
V2EX  ›  问与答

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

  •  
  •   alex321 · 2018-01-26 17:38:54 +08:00 · 783 次点击
    这是一个创建于 2446 天前的主题,其中的信息可能已经有所发展或是发生改变。
    今天发现一个现象,按照微信官方文档: 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

    所以,现在公众号网页授权的跳转是怎样的了?
    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1430 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 16:31 · PVG 00:31 · LAX 09:31 · JFK 12:31
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.