承接 stallionexpress/authutility 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

stallionexpress/authutility

最新稳定版本:0.0.41

Composer 安装命令:

composer require stallionexpress/authutility

包简介

Package to implement auth

README 文档

README

Latest Version on Packagist Total Downloads

This is where your description should go. Try and limit it to a paragraph or two, and maybe throw in a mention of what PSRs you support to avoid any confusion with users and contributors.

Installation

You can install the package via composer:

composer require stallionexpress/authutility

.env setup

Setup these keys in your .env file

AUTH_SERVER_URL="http://auth.stallionexpress.xyz"
CLIENT_ID="your client id"
CLIENT_SECRET="your client secret"
FRONT_END_URL="your front end redirect url"

Register provider

First add Register StallionExpress\AuthUtility\Providers\StallionServiceProvider in your config/app.php

'providers' => [
        StallionExpress\AuthUtility\Providers\StallionServiceProvider::class,
]

Register guard

Add the below code in your config/auth.php

'guards' => [
        'token' => [
            'driver' => 'access_token',
        ],
    ],

Middleware Usage

If you want to use our middleware to decode has value then add middleware to laravel project

step 1: add middleware to kernal

use StallionExpress\AuthUtility\Middleware\ReplaceRouteAndRequestHashValueMiddleware;

step 2: add middleware to kernal

protected $middlewareGroups = [
        'web' => [
            \App\Http\Middleware\EncryptCookies::class,
            \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
            \Illuminate\Session\Middleware\StartSession::class,
            \Illuminate\View\Middleware\ShareErrorsFromSession::class,
            \App\Http\Middleware\VerifyCsrfToken::class,
            ReplaceRouteAndRequestHashValueMiddleware::class,
            \Illuminate\Routing\Middleware\SubstituteBindings::class,
        ],

        'api' => [
            \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class,
            'throttle:api',
            ReplaceRouteAndRequestHashValueMiddleware::class,
            \Illuminate\Routing\Middleware\SubstituteBindings::class,
        ],
    ];

Trait Usage

If you want to use PrimaryIdEncodeTrait

  • Step 1: Import namespace
use StallionExpress\AuthUtility\Trait\PrimaryIdEncodeTrait;
  • Step 2: Add to use
use PrimaryIdEncodeTrait;

If you want to use STEncodeDecodeTrait

  • Step 1: Import namespace
use StallionExpress\AuthUtility\Trait\STEncodeDecodeTrait;
  • Step 2: Add to use
use STEncodeDecodeTrait;

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email avinashkant@stallionexpress.ca instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

  • lluminate/support": "^10.12.0"

统计信息

  • 总下载量: 3.01k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-05-25