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

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

createlinux/oauth
=================

v3.0.13(1y ago)0118MITPHPPHP &gt;=8.0

Since Aug 1Pushed 1y ago1 watchersCompare

[ Source](https://github.com/createlinux/oauth)[ Packagist](https://packagist.org/packages/createlinux/oauth)[ RSS](/packages/createlinux-oauth/feed)WikiDiscussions main Synced yesterday

READMEChangelogDependenciesVersions (43)Used By (0)

oauth
=====

[](#oauth)

oauth2.0 client package

在.env里配置以下参数

```
#客户端id
LITCHI_AUTH_CLIENT_ID=
#客户端秘钥
LITCHI_AUTH_CLIENT_SECRET=
#应用回调地址
LITCHI_AUTH_CLIENT_REDIRECT_URI=

#认证服务器服务器端url，开发时填写，正式环境可省略
LITCHI_AUTH_CENTER_SERVER_URI=
#认证服务器客户端端url，开发时填写，正式环境可省略
LITCHI_AUTH_CENTER_CLIENT_URI=

```

客户端代码示例，如果存在cookie内使用以下代码，如果存在localStorage则需要修改响应体

```
public function store(Request $request)
    {
        $code = $request->post('code');

        $oauthClient = create_litchi_oauth_client();

        if (!$code) {
            //build redirect url
            return Http::created("ok", [
                'redirect_uri' => $oauthClient->generateAuthCodeURI()
            ]);
        }

        $response = $oauthClient->createNewAuthToken($code);

        if (!$response->isSuccess()) {
            return Http::badRequest($response->getMessage());
        }

        return Http::created(context: [
            'access_token' => Crypt::encrypt($response->getAccessToken())
        ])->withCookie(
            cookie(
                'access_token',
                Crypt::encrypt($response->getAccessToken()),
                $response->getExpirationSeconds() / 60
            )
        );
    }
```

清除token示例，如果存在cookie内使用以下代码，如果存在localStorage则需要修改响应体

```
    public function destroy(Request $request, $me)
    {
        $accessToken = Cookie::get('access_token');
        $cookie = cookie(
            'access_token',
            null,
            -1
        );
        if (!$accessToken) {
            return Http::deleted('退出登录成功')->withCookie($cookie);
        }

        $oauthClient = create_litchi_oauth_client();
        $response = $oauthClient->removeAccessToken(Crypt::decrypt($accessToken));
        if (!$response->isSuccess()) {
            return Http::badRequest($response->getMessage());
        }

        return Http::deleted('退出登录成功')->withCookie($cookie);
    }
```

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance31

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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

Every ~8 days

Recently: every ~0 days

Total

42

Last Release

712d ago

Major Versions

v1.0.14 → v2.0.02024-06-05

v2.0.12 → v3.0.02024-06-12

### Community

Maintainers

![](https://www.gravatar.com/avatar/0171b38a9c3ad3f92fb8d4321374edb2bb9f1619dfcaa81784d53aad78d0e133?d=identicon)[GlaryJoker](/maintainers/GlaryJoker)

---

Top Contributors

[![createlinux](https://avatars.githubusercontent.com/u/24726354?v=4)](https://github.com/createlinux "createlinux (1 commits)")

### Embed Badge

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

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

###  Alternatives

[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)
