PHPackages                             onetech/oauth2-zparcel - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. onetech/oauth2-zparcel

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

onetech/oauth2-zparcel
======================

Package description here.

1.0.0(3y ago)01.7kMITPHP

Since Sep 16Pushed 3y ago1 watchersCompare

[ Source](https://github.com/xiaoguo0426/oauth2-zparcel)[ Packagist](https://packagist.org/packages/onetech/oauth2-zparcel)[ RSS](/packages/onetech-oauth2-zparcel/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

 oauth2-zparcel
================

[](#-oauth2-zparcel-)

 .

Installing
----------

[](#installing)

```
$ composer require onetech/oauth2-zparcel -vvv
```

Usage
-----

[](#usage)

```
$provider = new \Onetech\Oauth2Zparcel\Provider\Zparcel([
    'appId' => 'your appId',
    'clientId' => 'your clientId',
    'clientSecret' => 'your clientSecret',
    'redirectUri' => 'your redirectUri'
]);
//生成授权url
echo $provider->getAuthorizationUrl([
        'state' => mt_rand(10000, 99999),
        'version' => 'draft'
    ]) . PHP_EOL;

//授权成功后，浏览器回跳地址中的参数spapi_oauth_code值
try {
    $oauth = $provider->getAccessToken('authorization_code', [
        'code' => $_GET['spapi_oauth_code']
    ]);
    var_dump($oauth->getToken());
    var_dump($oauth->getRefreshToken());
    var_dump($oauth->getExpires());

    //    $token = $provider->getAccessToken('refresh_token', [
    //        'refresh_token' => ''
    //    ]);
    //    echo $token;
} catch (\League\OAuth2\Client\Provider\Exception\IdentityProviderException $e) {
}

```

Contributing
------------

[](#contributing)

You can contribute in one of three ways:

1. File bug reports using the [issue tracker](https://github.com/onetech/oauth2-zparcel/issues).
2. Answer questions or fix bugs on the [issue tracker](https://github.com/onetech/oauth2-zparcel/issues).
3. Contribute new features or update the wiki.

*The code contribution process is not very formal. You just need to make sure that you follow the PSR-0, PSR-1, and PSR-2 coding guidelines. Any new code contributions must be accompanied by unit tests where applicable.*

License
-------

[](#license)

MIT

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1332d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a431b0f260a9143f1a5eecbb283a906f2729834ae80972465916b0f2831d2847?d=identicon)[xiaoguo0426](/maintainers/xiaoguo0426)

### Embed Badge

![Health badge](/badges/onetech-oauth2-zparcel/health.svg)

```
[![Health](https://phpackages.com/badges/onetech-oauth2-zparcel/health.svg)](https://phpackages.com/packages/onetech-oauth2-zparcel)
```

###  Alternatives

[league/oauth2-google

Google OAuth 2.0 Client Provider for The PHP League OAuth2-Client

41721.2M118](/packages/league-oauth2-google)[knpuniversity/oauth2-client-bundle

Integration with league/oauth2-client to provide services

83416.7M61](/packages/knpuniversity-oauth2-client-bundle)[thenetworg/oauth2-azure

Azure Active Directory OAuth 2.0 Client Provider for The PHP League OAuth2-Client

2509.6M48](/packages/thenetworg-oauth2-azure)[stevenmaguire/oauth2-keycloak

Keycloak OAuth 2.0 Client Provider for The PHP League OAuth2-Client

2275.9M27](/packages/stevenmaguire-oauth2-keycloak)[patrickbussmann/oauth2-apple

Sign in with Apple OAuth 2.0 Client Provider for The PHP League OAuth2-Client

1132.5M6](/packages/patrickbussmann-oauth2-apple)[microsoft/kiota-authentication-phpleague

Authentication provider for Kiota using the PHP League OAuth 2.0 client to authenticate against the Microsoft Identity platform

153.2M7](/packages/microsoft-kiota-authentication-phpleague)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
