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 11y ago1 watchersCompare

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

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 13% 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

[kartik-v/yii2-password

Useful password strength validation utilities for Yii Framework 2.0

761.3M17](/packages/kartik-v-yii2-password)[vitalybaev/laravel5-dkim

Laravel 5/6 package for signing outgoing messages with DKIM.

3163.1k](/packages/vitalybaev-laravel5-dkim)

PHPackages © 2026

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