Wechat OAuth2.0 Authorization

Introduction

The WeChat Open Platformarrow-up-right (微信开放平台) provides a set of APIs that allow you to integrate WeChat login functionality into your website. Users can log in to your site using their WeChat credentials, simplifying the authentication process.

circle-check

WeChat Open Platform (微信开放平台) Website Application Setup

Within the WeChat Open Platform, create a new website app [创建网页应用].

The WeChat login feature requires a payment of 300 RMB to activate. After actived it, you will see your 微信登录接口状态 [已获得] like below. Take note of AppID and AppSecret credentials that will be used in your website's implementation.

Configure the Authorization Callback Domain [授权回调域]. This should be the domain website where redirect URL at after authorization. The configuration specification for the authorized callback domain requires a full domain name. For example, if the authorized callback domain is www.jinlala.netarrow-up-right, after configuration, pages under this domain such as https://www.jinlala.net/wechat-login.phparrow-up-right or https://www.jinlala.net/login.htmlarrow-up-right can both undergo OAuth 2.0 authentication.

Implementation on Your Website

login_wechat.php

Last updated