{"id":23176024,"url":"https://github.com/nexmo-community/verify-aws-cognito-php","last_synced_at":"2025-10-15T02:40:33.640Z","repository":{"id":37569483,"uuid":"275831171","full_name":"nexmo-community/verify-aws-cognito-php","owner":"nexmo-community","description":"Example in PHP for using Vonage Verify for 2FA with Amazon Cognito","archived":false,"fork":false,"pushed_at":"2024-11-01T08:17:22.000Z","size":42,"stargazers_count":3,"open_issues_count":5,"forks_count":1,"subscribers_count":11,"default_branch":"main","last_synced_at":"2024-11-01T09:20:21.052Z","etag":null,"topics":["2fa","aws","cognito","php","verify"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nexmo-community.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE-OF-CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-06-29T13:58:49.000Z","updated_at":"2023-09-13T19:49:35.000Z","dependencies_parsed_at":"2024-01-07T05:32:46.327Z","dependency_job_id":null,"html_url":"https://github.com/nexmo-community/verify-aws-cognito-php","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nexmo-community%2Fverify-aws-cognito-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nexmo-community%2Fverify-aws-cognito-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nexmo-community%2Fverify-aws-cognito-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nexmo-community%2Fverify-aws-cognito-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nexmo-community","download_url":"https://codeload.github.com/nexmo-community/verify-aws-cognito-php/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230225635,"owners_count":18193014,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["2fa","aws","cognito","php","verify"],"created_at":"2024-12-18T06:12:06.645Z","updated_at":"2025-10-15T02:40:28.569Z","avatar_url":"https://github.com/nexmo-community.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# verify-aws-cognito-php\nExample in PHP for using Vonage Verify for 2FA with Amazon Cognito\n\n## Setup Instructions\n\nClone this repo [nexmo-community/verify-aws-cognito-php](https://github.com/nexmo-community/verify-aws-cognito-php) and navigate into the newly created directory to proceed.\n\n### Install Dependencies\n\nThis example requires the use of Composer to install dependencies and set up the autoloader.\n\nAssuming you have Composer [installed globally](https://getcomposer.org/doc/00-intro.md#globally), run:\n\n```\ncomposer install\n```\n\n### AWS Setup\n\nThis example uses Amazon Cognito User Pools to hold users. I set up a User Pool as follows:\n\n1. Navigate to the [Amazon Cognito Dashboard](https://console.aws.amazon.com/cognito/home) in the AWS Console.\n1. Select `Manage User Pools`.\n1. Create a new user pool.\n    * Give the pool a name, and click `Step through settings`\n    * Select `Email address or phone number` and pick `Allow email addresses`\n    * Click `Next step`\n    * Set the minimum password length, and desired complexity settings\n    * Make sure to `Allow users to sign themselves up`\n    * Click `Next step`\n    * Leave the next step as-is, for this example. We will use Vonage for 2FA\n    * Click `Next step`\n    * Select a `FROM email address ARN` from the dropdown. This assumes you've already created an idenity in [Amazon Simple Email Service(SES)](https://console.aws.amazon.com/ses/home#verified-senders-email:)\n    * Add a `FROM email address` as desired.\n    * Leave the rest of this page unchanged. However, I do recommend you remove the trailing periods from the email messages. This prevents the recipient from mistakenly using the period as part of the temporary password.\n    * Click `Next step`\n    * Skip adding tags by clicking `Next step`\n    * Skip devices by clicking `Next step`\n    * Click the link to `Add an app client`\n    * Give the app client a name\n    * Uncheck the box to `Generate client secret`\n    * Check the rest of the boxes\n    * Click `Create app client`\n    * Click `Next step`\n    * Skip triggers by clicking `Next step`\n    * Click `Create pool`\n\n### Update Environment\n\nRename the provided `.env.default` file to `.env` and update the values as needed:\n\n```env\nAWS_PROFILE=default\nAWS_ACCESS_KEY_ID=\u003caws-access-key-id\u003e\nAWS_SECRET_ACCESS_KEY=\u003caws-secret-access-key\u003e\nAWS_VERSION=latest\nAWS_REGION=us-east-1\nAWS_CLIENT_ID=\u003caws-client-id\u003e\nAWS_USERPOOL_ID=\u003caws-userpool-id\u003e\nNEXMO_API_KEY=\u003cnexmo-api-key\u003e\nNEXMO_API_SECRET=\u003cnexmo-api-secret\u003e\n```\n\n_*NOTE:* All placeholders noted by `\u003c\u003e` need to be updated. Update the others as needed._\n\n## Launch or Deploy\n\nTest the app by running it locally with the PHP built-in webserver with the command:\n\n```bash\nphp -S localhost:8080\n```\n\nView the main landing page by going to `http://localhost:8080` in a web browser.\n\n\u003e IMPORTANT: Though this app functions, `as-is` it is intended for educational purposes and is not ready for production/public use.\n\n## Functionality\n\nThe app flow is as follows:\n\n* From the main page, click either `Login` or `Register`.\n    * After registration (`user_register.php`) the user is redirected to a mandatory password change page. (`login_reset.php`) Here they should utilize the temporary password emailed to them.\n    * After updating the temporary password the user is redirected to the login page. (`login.php`)\n    * The login is where a new user, or an existing user can login.\n    * After successful login, the user is redirected to the 2FA verification page. (`login_verify.php`) Here they enter the 6 digit code sent to their mobile number.\n    * Upon successful 2FA verification, the user is then redirected back to the main page (`index.php`) where they see they are now logged in with an option to logout. (`logout.php`)\n\n## Contributing\n\nWe love questions, comments, issues - and especially pull requests. Either open an issue to talk to us, or reach us on twitter: \u003chttps://twitter.com/VonageDev\u003e.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnexmo-community%2Fverify-aws-cognito-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnexmo-community%2Fverify-aws-cognito-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnexmo-community%2Fverify-aws-cognito-php/lists"}