V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
xiaoduoduoduo

如何验证 openid 的合法性?

  •  
  •   xiaoduoduoduo · Sep 7, 2016 · 5562 views
    This topic created in 3518 days ago, the information mentioned may be changed or developed.

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

    1 replies    2016-09-07 16:28:57 +08:00
    hiro0729
        1
    hiro0729  
       Sep 7, 2016
    微信有个 API 是通过 access_token 和 openid 获取用户信息的接口,如果不合法会返回{"errcode":40013,"errmsg":"invalid appid"}。
    所以 access_token 是关键,这个东西是在客户服务器后台调用微信接口的凭证。所以得让他们在后台开个接口来验证 openid ,或者就是约定从客户方调用的 openid 一定没问题。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5654 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 01:36 · PVG 09:36 · LAX 18:36 · JFK 21:36
    ♥ Do have faith in what you're doing.