WeChat open platform-PHP WeChat login Authorization Issue

Source: Internet
Author: User
About login authorization issues, I index.php in the code
header('location:https://open.weixin.qq.com/connect/oauth2/authorize?appid=我的appid&redirect_uri=192.168.1.127%2foauth2.php&response_type=code&scope=snsapi_login&state=1#wechat_redirect');
Then open in 192.168.1.127, according to the code will jump to the authorization page, after the successful authorization, according to my understanding should jump to 192.168.1.127/oauth.php&code=xxxxxx&state=xxx, But not jump to the past, but jump to
Https://open.weixin.qq.com/connect/oauth2/192.168.1.127/oauth.php?code ...; Ask what's going on here?

Reply content:

About login authorization issues, I index.php in the code
header('location:https://open.weixin.qq.com/connect/oauth2/authorize?appid=我的appid&redirect_uri=192.168.1.127%2foauth2.php&response_type=code&scope=snsapi_login&state=1#wechat_redirect');
Then open in 192.168.1.127, according to the code will jump to the authorization page, after the successful authorization, according to my understanding should jump to 192.168.1.127/oauth.php&code=xxxxxx&state=xxx, But not jump to the past, but jump to
Https://open.weixin.qq.com/connect/oauth2/192.168.1.127/oauth.php?code ...; Ask what's going on here?

redirect_uriYou should take scheme it, http://example.com/foo.php.

Before the public can request the user to authorize the Web page, the developer must first configure the authorization callback domain name on the Developer Center page of the public platform website. Please note that this is the domain name (a string), not the URL, so do not add http://and other protocol headers;----Development documentation The first article on the description of the Web page authorization callback domain name

Your callback address is not added HTTP//

Callback address please use the standard URL address: http (s)://subdomain.domain.com/segment1/setment2/setmentn ...

    1. Redirect_uri should take scheme, http://www.example.com/auth.php.

    2. Need to configure the domain name authorized on the website in the Public Platform Developer Center, note that the domain name here is the above example.com

Cannot use IP ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.