老司机们求助:
现在有一个需求:
微信朋友圈分享链接规则:
https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxf0e81c3bee622d60&redirect_uri=http%3A%2F%2Fnba.bluewebgame.com%2Foauth_response.php&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect
snsapi_userinfo
是显式绑定
用户同意授权后,微信返回code
码。
因为公司安全要求,分享页面不合适继续调用https://api.weixin.qq.com/sns/oauth2/access_tokenappid=APPID&secret=SECRET&code=CODE&grant_type=authorization_code
接口置换出access_token
, refresh_token
和openid
这一步,改成用code
码调公司接口。
微信规定code
码只能使用一次或者5分钟过期。业务场景下,需要多次使用code
码,目前能找到刷新code
码的方式有2种:
scope为snsapi_base
https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx520c15f417810387&redirect_uri=https%3A%2F%2Fchong.qq.com%2Fphp%2Findex.php%3Fd%3D%26c%3DwxAdapter%26m%3DmobileDeal%26showwxpaytitle%3D1%26vb2ctag%3D4_2030_5_1194_60&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=http%3A%2F%2Fnba.bluewebgame.com%2Foauth_response.php&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect
scope为snsapi_base
和snsapi_userinfo
以上是上下文,有如下问题求助老司机:
- 如果用
snsapi_userinfo
,第2,3,4...次调用以获取code,每次都会再弹出一次授权蒙层吗? - 注意到微信文档:
https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421140842
获取code时,有一个10009,操作太频繁了,请稍后重试
错误返回码。实际中,多少次算操作频繁。 -
openid
适合明文或密文在网络传输吗?
你这不是授权获取用户信息么,关朋友圈分享什么事?
因为公司安全要求,分享页面不合适继续调用
https://api.weixin.qq.com/sns...
如果用snsapi_userinfo,第2,3,4...次调用以获取code
你获取那么多次用户信息干嘛???