Skip to content

genzouw/aws-cognito-example

Repository files navigation

AWS Cognito Example

Description

This is a sample program for verifying that server-side authentication has been performed after client authentication using "Amazon Cognito".

Requirements

Web Server (Apache / Nginx / ... etc)

Dependencies

None.

However, if you want to use a mechanism for server-side verification of "ID Token", you will need the following:

  • PHP
  • Composer

Installation

$ git clone git@github.com:genzouw/aws-cognito-example.git

$ cd aws-cognito-example

Usage

  1. Set the html/ directory as the document root and make it accessible by a browser.
  2. Set the following environment variables. Please refer to the user pool setting page of "Amazon Cognito" for the setting value.
    • COGNITO_DOMAIN
    • COGNITO_REGION_ID
    • COGNITO_USERPOOL_ID
    • COGNITO_CLIENT_ID
    • COGNITO_CALLBACK_URL=http://localhost:8080/callback.php

If the php command is available, the php -S command is available.

$ pwd
aws-cognito-example

# Move "Document root"
$ cd html

$ COGNITO_DOMAIN=YOUR_DOMAIN
$ COGNITO_REGION_ID=YOUR_REGION_ID
$ COGNITO_USERPOOL_ID=YOUR_USERPOOL_ID
$ COGNITO_CLIENT_ID=YOUR_CLIENT_ID
$ COGNITO_CALLBACK_URL=http://localhost:8080/callback.php

$ php -S localhost:8080

If you are using Apache, set environment variables using "SetEnv" directive.

Relase Note

date version note
2019-05-28 0.1 first release.

License

This software is released under the MIT License, see LICENSE.

Author Information

genzouw

About

This is a sample program for verifying that server-side authentication has been performed after client authentication using "Amazon Cognito".

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published