This is a sample program for verifying that server-side authentication has been performed after client authentication using "Amazon Cognito".
Web Server (Apache / Nginx / ... etc)
None.
However, if you want to use a mechanism for server-side verification of "ID Token", you will need the following:
- PHP
- Composer
$ git clone [email protected]:genzouw/aws-cognito-example.git
$ cd aws-cognito-example
- Set the
html/
directory as the document root and make it accessible by a browser. - 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.
date | version | note |
---|---|---|
2019-05-28 | 0.1 | first release. |
This software is released under the MIT License, see LICENSE.
- Twitter : @genzouw ( https://twitter.com/genzouw )
- Facebook : genzouw ( https://www.facebook.com/genzouw )
- LinkedIn : genzouw ( https://www.linkedin.com/in/genzouw/ )
- Gmail : [email protected]