承接 iwouldrathercode/cognito 相关项目开发

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

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

iwouldrathercode/cognito

Composer 安装命令:

composer require iwouldrathercode/cognito

包简介

Simple laravel package to work with aws-php-sdk and amazon cognito

README 文档

README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Simple laravel package to work with aws-php-sdk and amazon cognito. Once installed it can generate api routes to work with cognito apis and generate and validate jwt tokens

Installation & Setup

Step 1

You can install the package via composer:

composer require iwouldrathercode/cognito

Step 2

Run the setup command to install dependencies and link the storage folder to public folder

php artisan cognito:setup

Step 3

Run the install command to publish the config files and migrations

php artisan cognito:install

Step 4

Execute the migrations. This will update the users table and since passwords are no longer managed by laravel, this will also delete the password_resets table

php artisan migrate

Step 5

Update the config/auth.php with default guard as api

    ..
    ..

    'defaults' => [
        'guard' => 'api',
        'passwords' => 'users',
    ],
    ..
    ..

Step 6

Update the config/auth.php, guards array with config of api using 'cognito' as driver

    ..
    ..
    'guards' => [
        ..
        ..

        'api' => [
            'driver' => 'cognito',
            'provider' => 'users'
        ]
    ],
    ..
    ..

Step 7

Ensure the env variables of the cognito UserPool and ClientID are at .env this will affect congig/cognito.php config file

AWS_COGNITO_USER_POOL_ID=
AWS_COGNITO_CLIENT_ID=
AWS_DEFAULT_REGION=

Usage

This package will create /api routes to manage authentication

POST -> api/confirm-forgot-password -> confirm-forgot-password › 
Iwouldrathercode\Cognito\Http\Controllers\SelfServiceController@confirmForgotPassword

POST -> api/forgot-password -> forgot-password › Iwouldrathercode\Cognito\Http\Controllers\SelfServiceController@forgotPassword

POST -> api/login -> signin › 
Iwouldrathercode\Cognito\Http\Controllers\LoginController@login

POST -> api/register -> signup › 
Iwouldrathercode\Cognito\Http\Controllers\RegisterController@register

POST -> api/verify -> verify › 
Iwouldrathercode\Cognito\Http\Controllers\EmailVerificationController@verify

POST -> api/logout -> signout › 
Iwouldrathercode\Cognito\Http\Controllers\LoginController@logout

TODO

  • Create valid Unit Test cases

Changelog

Please see CHANGELOG for more information on what has changed recently.

Credits

License

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-10-09

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固