V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
xiaoduoduoduo
V2EX  ›  信息安全

如何验证 openid 的合法性?

  •  
  •   xiaoduoduoduo · 2016-09-07 11:40:12 +08:00 · 4976 次点击
    这是一个创建于 2794 天前的主题,其中的信息可能已经有所发展或是发生改变。

    给客户做的小游戏,打包过测试说要验证 openid 的合法性。微信 openid 是通过 weixin.php 从客户方调用的。

    1 条回复    2016-09-07 16:28:57 +08:00
    hiro0729
        1
    hiro0729  
       2016-09-07 16:28:57 +08:00
    微信有个 API 是通过 access_token 和 openid 获取用户信息的接口,如果不合法会返回{"errcode":40013,"errmsg":"invalid appid"}。
    所以 access_token 是关键,这个东西是在客户服务器后台调用微信接口的凭证。所以得让他们在后台开个接口来验证 openid ,或者就是约定从客户方调用的 openid 一定没问题。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   730 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 20:52 · PVG 04:52 · LAX 13:52 · JFK 16:52
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.