Home  >  Article  >  Backend Development  >  WeChat web page authorization login to Android failed! Success on iOS!

WeChat web page authorization login to Android failed! Success on iOS!

WBOY
WBOYOriginal
2016-08-10 09:07:261800browse

Today I did a WeChat web page authorization login, and encountered a very pitiful problem. I used the WeChat test account to do the web page authorization login. Local debugging is possible on both the Android and iOS sides, but it can be deployed to the official server, iOS, android. It was always not possible. Later, when debugging, I found that when authorizing login on Android, there was always an error in getting the openid based on the code after the authorization callback was completed. However, it was always successful on iOS. I couldn't figure it out after a day. There was no problem with local debugging. Does anyone know the reason? I’m asking for help after searching various information on the Internet to no avail.

Getting openid android returns failure information: {"errcode":40029,"errmsg":"invalid code, hints: [ req_id: 8H_oSa0564ns12 ]"}

I debugged today and found that the iOS side only authorized once, so the user information was returned successfully. However, after the first authorization was successful on Android, it authorized again, and the code to obtain the access_token can only be used once, so it failed. , does anyone know the reason or solution why it authorized twice?

Reply content:

Today I did a WeChat web page authorization login, and encountered a very pitiful problem. I used the WeChat test account to do the web page authorization login. Local debugging is possible on both the Android and iOS sides, but it can be deployed to the official server, iOS, android. It was always not possible. Later, when debugging, I found that when authorizing login on Android, there was always an error in getting the openid based on the code after the authorization callback was completed. However, it was always successful on iOS. I couldn't figure it out after a day. There was no problem with local debugging. Does anyone know the reason? I’m asking for help after searching various information on the Internet to no avail.

Getting openid android returns failure information: {"errcode":40029,"errmsg":"invalid code, hints: [ req_id: 8H_oSa0564ns12 ]"}

I debugged today and found that the iOS side only authorized once, so the user information was returned successfully. However, after the first authorization was successful on Android, it authorized again, and the code to obtain the access_token can only be used once, so it failed. , does anyone know the reason or solution why it authorized twice?

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn