tuanha/auth-api-gateway

该软件包最新版本(1.1.5)没有提供许可证信息。

使用服务身份验证的软件包登录

1.1.5 2019-12-25 02:13 UTC

This package is auto-updated.

Last update: 2024-09-25 20:17:30 UTC


README

下载软件包后,请按照以下步骤进行操作以使用它

配置env文件以与Server Auth的Redis服务器匹配

例如

  • BROADCAST_DRIVER=log

  • CACHE_DRIVER=file

  • QUEUE_CONNECTION=sync

  • SESSION_DRIVER=redis

  • SESSION_LIFETIME=1200

  • CACHE_PREFIX=LONGND

  • REDIS_CLIENT=predis

  • REDIS_HOST=127.0.0.1

  • REDIS_PASSWORD=null

  • REDIS_PORT=6379

修改配置文件以匹配

  • 在app.php文件中添加提供者:ViralMS\AuthApiGateway\AuthApiGatewayServiceProvider::class,
  • 在database文件中隐藏行:'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'),

运行发布供应商

  • 运行命令:php artisan vendor:publish --provider=ViralMS\AuthApiGateway\AuthApiGatewayServiceProvider

在Kernel.php文件中替换Auth中间件

  • 'auth' => \ViralMS\AuthApiGateway\AuthenticateRedis::class,
  • 'guest' => \ViralMS\AuthApiGateway\RedirectIfAuthenticatedRedis::class,