Download the PHP package tourze/wechat-official-account-oauth2-bundle without Composer

On this page you can find all versions of the php package tourze/wechat-official-account-oauth2-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package wechat-official-account-oauth2-bundle

WeChat Official Account OAuth2 Bundle

中文

PHP Version Latest Version License Total Downloads

A complete OAuth2 authorization solution for WeChat Official Accounts in Symfony applications.

Table of Contents

Features

Installation

1. Install via Composer

2. Add Bundle to Kernel

3. Database Migration

4. Configure WeChat Official Account

Ensure you have configured your WeChat Official Account information in wechat-official-account-bundle.

Usage

1. Create OAuth2 Application

Parameters:

2. OAuth2 Authorization Flow

Step 1: User Authorization

Redirect users to the authorization page:

Parameters:

Step 2: Get Access Token

Exchange authorization code for access token:

Response Example:

Step 3: Get User Information

Get user information using access token:

Step 4: Refresh Access Token

3. Token Management

Revoke Token

Token Introspection

4. Console Commands

OAuth2 Configuration Command

Configure OAuth2 settings for WeChat Official Account:

Parameters:

Examples:

Refresh Token Command

Automatically refresh expiring access tokens:

Parameters:

5. Scheduled Cleanup

It's recommended to set up a cron job to clean up expired tokens:

API Endpoints

| Endpoint | Method | Description | | /oauth2/authorize | GET | User authorization page | | /oauth2/callback | GET | WeChat authorization callback | | /oauth2/token | POST | Get access token | | /oauth2/refresh | POST | Refresh access token | | /oauth2/revoke | POST | Revoke token | | /oauth2/userinfo | GET/POST | Get user information | | /oauth2/introspect | POST | Token introspection |

Authorization Scopes

Error Handling

All error responses follow the OAuth2 standard format:

Common Error Codes:

Security Recommendations

  1. 🔒 Keep Client Secret secure and avoid leakage
  2. 🌐 Only use OAuth2 features in HTTPS environment
  3. ✅ Strictly validate redirect_uri parameter
  4. ⏰ Set reasonable token expiration times
  5. 🧹 Regularly clean up expired authorization codes and tokens

Development and Testing

Running Tests

Note: Some integration tests may experience conflicts due to Symfony configuration class loading in the same PHP process. This is a known issue tracked in Issue #774. Unit tests (Entity, Exception tests) run without issues.

Code Quality Checks

Service Classes

OAuth2AuthorizationService

OAuth2UserInfoService

WechatOAuth2Service

Dependencies

This bundle depends on the following components:

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contributing

Contributions are welcome! Please feel free to submit issues and pull requests.


📝 Note: Before using in production, ensure all features are thoroughly tested and configured according to WeChat's official documentation.


All versions of wechat-official-account-oauth2-bundle with dependencies

PHP Build Version
Package Version
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package tourze/wechat-official-account-oauth2-bundle contains the following files

Loading the files please wait ...