threeperson
发布于 2018-04-13 / 0 阅读
0
0

{"errcode":40001,"errmsg":"invalid credential

近日接入微信公众号,获取用户信息时提示invalid credential

```

{"errcode":40001,"errmsg":"invalid credential, access_token is invalid or not latest hint: [9j.bJa08

```

```

String CODE_URL = "https://open.weixin.qq.com/connect/oauth2/authorize?appid={}&redirect_uri={}&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect";

String TOKEN_URL = "https://api.weixin.qq.com/sns/oauth2/access_token?appid={}&secret={}&code={}&grant_type=authorization_code";

//非网页授权-获取用户信息地址

//String INFO_URL = "https://api.weixin.qq.com/cgi-bin/user/info?openid={}&access_token={}&lang=zh_CN";

//网页授权-获取用户信息地址

String INFO_URL = "https://api.weixin.qq.com/sns/userinfo?openid={}&access_token={}&lang=zh_CN";

```


评论