php - Wechat : OAuth with test account -
i'm trying set oauth login wechat web application. so, have create account on wechat, , used test account have access unlimited.
so, on test account configuration, have validate token wechat (see here : http://admin.wechat.com/wiki/index.php?title=getting_started).
on doc, oauth explain here : http://admin.wechat.com/wiki/index.php?title=user_profile_via_web
we must redirect user url login: https://open.weixin.qq.com/connect/oauth2/authorize?appid=appid&redirect_uri=redirect_uri&response_type=code&scope=scope&state=state#wechat_redirect
i have replace appid test account appid, redirect uri : http://wechat.mydomain.net, scope correct 1 (snsapi_userinfo) , remove state param (optional). but, had error on wechat :
oops! went wrong:(
after hours of research, set domain on "api permission list", in " webpage account"
but have error. maybe missing something, don't find what. there final url called : https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx8ytvf5838cc7t33d&redirect_uri=http://wechat.mydomain.net/wechat/callback&response_type=code&scope=snsapi_userinfo&connect_redirect=1#wechat_redirect
thanks !
hope still relevant (or else)
the wechat oauth seems available official account , not supported in test account.
if have approved official account, can check under permissions tab in admin.
anyway - login callback always return error if not called wechat native application. can not open in browser.
you can check php class @ github, includes (for now) oauth , messages engine: https://github.com/nitzanb/wechat-class
Comments
Post a Comment