使用 laravel 进行 AWS cognito 用户身份验证

AWS cognito user authentication with laravel

我们正在尝试使用我们内置的 laravel 5.1 应用程序实施用于用户身份验证的 Amazon Cognito 服务。我们正在寻找 laravel 5.1 的 composer 包,它允许 Amazon Cognito 用户池、将用户注册到用户池、密码重置等。

您可以使用 Composer PHP 的 AWS 开发工具包。请参阅此 guide 的以下引用步骤。

  1. Open a terminal window and navigate to the directory where your project is stored. Composer is installed on a per-project basis.
  2. Download and install Composer in your project directory. If you have curl installed, you can use the following command:

    curl -sS https://getcomposer.org/installer | php
    

    When the installation script finishes, a composer.phar file will be created in the directory where you ran the installer.

  3. Create a file at the root level of your project called composer.json and add the following dependency for the AWS PHP SDK:

    {
        "require": {
            "aws/aws-sdk-php": "2.*"
        }
    }
    
  4. Install the dependencies by running Composer's install command:

    php composer.phar install
    

    This will create a vendor directory in your project with the required libraries and an autoloader script used to load them for your project.

  5. Require Composer's autoloader by adding the following line to your code's bootstrap process (typically in index.php):

    require '/path/to/sdk/vendor/autoload.php';
    

    Your code is now ready to use the AWS SDK for PHP!

AWS 还在 Version 3.32.7. You may have a look at AWS Service Provider for Laravel 中添加了 Cognito 用户池管理以获取更多信息。

这个问题很老了,但是对于正在寻找此类软件包的人来说,请检查一下,我认为这就是您所需要的

https://github.com/black-bits/laravel-cognito-auth