PHPackages                             slince/oauth - 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. slince/oauth

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

slince/oauth
============

slince oauth library

115PHP

Since Jun 21Pushed 10y ago1 watchersCompare

[ Source](https://github.com/slince-archived/oauth)[ Packagist](https://packagist.org/packages/slince/oauth)[ RSS](/packages/slince-oauth/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

slince oauth2.0 library
=======================

[](#slince-oauth20-library)

oauth是对oAuth2.0协议的封装支持，如果您对oAuth2.0不了解的话，可以参考；通过oauth您可以方便的获取登录用户的信息以及服务商提供的其它资料和服务；

\##目前支持的服务

- baidu
- weibo
- qq

（后续还在增加中）

使用方式
----

[](#使用方式)

```
use Slince\OAuth\Certificate\Certificate;
use Slince\OAuth\ServiceFactory;
use Slince\OAuth\Token\Token;

$certificate = new Certificate(
    client id,
    client secret,
    callbackurl
);
$token = new Token();
$baidu = ServiceFactory::get('baidu', $certificate, $token);
if (empty($_GET['code'])) {
	echo $location = $baidu->getAuthorizeUrl();
header("location: {$location}");
} else {
    $token = $baidu->requestToken($_GET['code']);
    echo $token->getAccessToken();
    $token = $baidu->refreshToken($token);
    echo $token->getAccessToken();
    $user = $baidu->request('passport/users/getInfo');
    print_r($user);
}

```

详细使用方式请参考demo下的案例

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3785826?v=4)[Tao](/maintainers/slince)[@slince](https://github.com/slince)

### Embed Badge

![Health badge](/badges/slince-oauth/health.svg)

```
[![Health](https://phpackages.com/badges/slince-oauth/health.svg)](https://phpackages.com/packages/slince-oauth)
```

###  Alternatives

[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[gesdinet/jwt-refresh-token-bundle

Implements a refresh token system over Json Web Tokens in Symfony

70516.4M35](/packages/gesdinet-jwt-refresh-token-bundle)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)[beatswitch/lock

A flexible, driver based Acl package for PHP 5.4+

870304.7k2](/packages/beatswitch-lock)[amocrm/amocrm-api-library

amoCRM API Client

182728.5k6](/packages/amocrm-amocrm-api-library)[vonage/jwt

A standalone package for creating JWTs for Vonage APIs

424.1M4](/packages/vonage-jwt)

PHPackages © 2026

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