{"id":20022159,"url":"https://github.com/modxcms/twilio","last_synced_at":"2026-01-05T10:01:39.220Z","repository":{"id":136670795,"uuid":"457432749","full_name":"modxcms/twilio","owner":"modxcms","description":"MODX Extra for Twilio Validation or something like that","archived":false,"fork":false,"pushed_at":"2025-01-06T21:58:51.000Z","size":183,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-04-19T19:30:20.763Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/modxcms.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.MD","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-02-09T16:12:50.000Z","updated_at":"2025-01-06T21:58:54.000Z","dependencies_parsed_at":"2023-09-26T19:57:31.260Z","dependency_job_id":"3a3b9e84-2874-4a2f-9ca8-46f5566bfdf4","html_url":"https://github.com/modxcms/twilio","commit_stats":{"total_commits":39,"total_committers":2,"mean_commits":19.5,"dds":"0.10256410256410253","last_synced_commit":"a2f60320f706adb7e2cf6cb981bb6febc842f44f"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/modxcms%2Ftwilio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/modxcms%2Ftwilio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/modxcms%2Ftwilio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/modxcms%2Ftwilio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/modxcms","download_url":"https://codeload.github.com/modxcms/twilio/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251311948,"owners_count":21569131,"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":[],"created_at":"2024-11-13T08:39:22.608Z","updated_at":"2026-01-05T10:01:38.884Z","avatar_url":"https://github.com/modxcms.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Twilio Verify\n\nTwilio is a verification service that allows you to send a code to a user's phone or use a time-based one time password to verify their identity. You can find more information on Twilio at [https://www.twilio.com/](https://www.twilio.com/referral/BSq3ra). This is not a free service, so you will need to sign up for a Twilio account. Each successful verification will cost you $0.05, so this is something to consider before implementing.\n\n## Phone Verification \n\n###  Sample Registration page\n\n```html\n\u003clink\n    rel=\"stylesheet\"\n    href=\"https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/17.0.8/css/intlTelInput.css\"\n/\u003e\n\u003cscript src=\"https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/17.0.8/js/intlTelInput.min.js\"\u003e\u003c/script\u003e\n\n[[!Register?\n    \u0026postHooks=`TwilioActivation`\n    \u0026submitVar=`registerbtn`\n    \u0026moderate=`1`\n    \u0026customValidators=`TwilioValidatePhone`\n    \u0026twilioActivationResourceId=`2`\n    \u0026twilioActivationEmailTpl=`myActivationEmailTpl`\n    \u0026usernameField=`email`\n    \u0026validate=`nospam:blank,\n  phone:TwilioValidatePhone,\n  password:required:minLength=^6^,\n  password_confirm:password_confirm=^password^,\n  email:required:email`\n    \u0026placeholderPrefix=`reg.`\n]]\n\n\u003cdiv class=\"register\"\u003e\n    \u003cdiv class=\"registerMessage\"\u003e[[!+reg.error.message]]\u003c/div\u003e\n\n    \u003cform class=\"form\" action=\"[[~[[*id]]]]\" method=\"post\"\u003e\n        \u003cinput type=\"hidden\" name=\"nospam\" value=\"[[!+reg.nospam]]\" /\u003e\n\n        \u003clabel for=\"email\"\u003eEmail\n            \u003cspan class=\"error\"\u003e[[!+reg.error.email]]\u003c/span\u003e\n        \u003c/label\u003e\n        \u003cinput type=\"text\" name=\"email\" id=\"email\" value=\"[[!+reg.email]]\" /\u003e\n\n        \u003clabel for=\"phone\"\u003ePhone\n            \u003cspan class=\"error\"\u003e[[!+reg.error.phone]]\u003c/span\u003e\n        \u003c/label\u003e\n        \u003cinput type=\"text\" id=\"phone\" value=\"[[!+reg.phone]]\" /\u003e\n        \n        \u003clabel for=\"password\"\u003ePassword\n            \u003cspan class=\"error\"\u003e[[!+reg.error.password]]\u003c/span\u003e\n        \u003c/label\u003e\n        \u003cinput type=\"password\" name=\"password\" id=\"password\" value=\"[[!+reg.password]]\" /\u003e\n\n        \u003clabel for=\"password_confirm\"\u003eConfirm Password\n            \u003cspan class=\"error\"\u003e[[!+reg.error.password_confirm]]\u003c/span\u003e\n        \u003c/label\u003e\n        \u003cinput type=\"password\" name=\"password_confirm\" id=\"password_confirm\" value=\"[[!+reg.password_confirm]]\" /\u003e\n\n        \u003cdiv class=\"form-buttons\"\u003e\n            \u003cinput type=\"submit\" name=\"registerbtn\" value=\"Register\" /\u003e\n        \u003c/div\u003e\n    \u003c/form\u003e\n\u003c/div\u003e\n\n\u003cscript\u003e\n    var phoneInputField = document.querySelector(\"#phone\");\n    window.intlTelInput(phoneInputField, {\n        hiddenInput: \"phone\",\n        utilsScript: \"https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/17.0.8/js/utils.js\",\n    });\n\u003c/script\u003e\n```\n\n### Sample Activation Page (\u0026twilioActivationResourceId)\n\n```html\n[[!TwilioGetPhone]]\n\n[[!FormIt?\n   \u0026hooks=`TwilioSendVerification`\n   \u0026submitVar=`get-validation`\n   \u0026validate=`channel:required`\n]]\n\nPhone: [[!+twilio.phone]]\n\u003cform action=\"\" method=\"post\" class=\"form\"\u003e\n\u003clabel\u003eChannel: [[!+fi.error.channel]]\u003c/label\u003e\n\u003cinput type=\"radio\" name=\"channel\" value=\"sms\" [[!+fi.channel:FormItIsChecked=`sms`]] \u003e SMS\n\u003cinput type=\"radio\" name=\"channel\" value=\"call\" [[!+fi.channel:FormItIsChecked=`call`]] \u003e Call\n    \u003cdiv class=\"form-buttons\"\u003e\n        \u003cinput type=\"submit\" name=\"get-validation\" value=\"Validate my phone\" /\u003e\n    \u003c/div\u003e\n\u003c/form\u003e\n\n[[!+twilio.code_sent]]\n\n[[!FormIt?\n   \u0026hooks=`TwilioVerify`\n   \u0026twilioRedirect=`4`\n   \u0026placeholderPrefix=`fiv.`\n   \u0026submitVar=`verify`\n   \u0026validate=`code:required`\n]]\n\n\u003cform action=\"\" method=\"post\" class=\"form\"\u003e\n    \u003clabel for=\"code\"\u003e\n        Code:\n        \u003cspan class=\"error\"\u003e[[!+fiv.error.code]]\u003c/span\u003e\n    \u003c/label\u003e\n    \u003cinput type=\"text\" name=\"code\" id=\"code\" value=\"[[!+fiv.code]]\" /\u003e\n    \u003cdiv class=\"form-buttons\"\u003e\n        \u003cinput type=\"submit\" name=\"verify\" value=\"Validate my phone\" /\u003e\n    \u003c/div\u003e\n\u003c/form\u003e\n```\n\n## Time-based One Time Password\n\n### Sample Challenge Page\n\nCreate a challenge page and set the system setting `twilio.totp_challenge_page` to the page ID.\n\n```html\n[[!FormIt?\n    \u0026hooks=`TwilioTOTPChallenge,TwilioVerify`\n    \u0026twilioRedirect=`4` // ID of the page to redirect to after verification\n    \u0026twilioFactorType=`totp`\n    \u0026validate=`code:required`\n]]\n\u003cform method=\"post\"\u003e\n    \u003clabel\u003e\n        Enter 2FA Code\n        \u003cinput name=\"code\" value=\"\" /\u003e\n    \u003c/label\u003e\n    \u003cbutton type=\"submit\"\u003eSubmit\u003c/button\u003e\n\u003c/form\u003e\n```\n\n### Sample Create/Reset Token Page\n\nCreate a page with the following content:\n\n```html\n[[TwilioTOTPCreate?twilioRedirect=`4`]]\n```\n\n### Sample Profile Page\n\n```html\n[[!TwilioTOTPqr]]\n\n[[!+twilio.qr:ne=``:then=`\n    \u003cimg src=\"[[!+twilio.qr]]\" /\u003e\n    \u003cp\u003eSecret [[!+twilio.secret]]\u003c/p\u003e\n    [[!+twilio.status:is=`unverified`:then=`\n        \u003cp\u003e\u003ca href=\"[[~5]]\"\u003e\u003cstrong\u003eVerify 2FA Code Before Next Login\u003c/strong\u003e\u003c/a\u003e\u003c/p\u003e \u003c!-- link to challenge page --\u003e\n    `:else=``]]\n    \u003cp\u003e\u003ca href=\"[[~6]]\"\u003eRefresh 2FA\u003c/a\u003e\u003cbr /\u003e \u003c!-- link to create / refresh page --\u003e\n    \u003ca href=\"[[~6?status=`disable_totp`]]\"\u003eDisable 2FA\u003c/a\u003e\u003c/p\u003e\n`:else=`\n    \u003ca href=\"[[~6]]\"\u003eEnable 2FA\u003c/a\u003e\n`]]\n```\n\n## System Settings\n\n| key                        | description                                                                                               |\n|----------------------------|-----------------------------------------------------------------------------------------------------------|\n| twilio.account_sid         | Twilio Account SID - Found under Account Info here https://console.twilio.com/                            |\n| twilio.account_token       | Twilio Auth Token - Found under Account Info here https://console.twilio.com/                             |\n| twilio.service_id          | Twilio Service ID - Found under Services Page here https://console.twilio.com/us1/develop/verify/services |\n| twilio.totp_enforce        | Enforce 2FA for all users                                                                                 |\n| twilio.totp_email_on_login | Email a code to the user when they login                                                                  |\n| twilio.totp_challenge_page | Page ID of the challenge page                                                                             |\n| twilio.totp_allow_expired  | Allow expired two-factor verification codes to regenerate new two-factor authentication codes.            |\n\n## Manager Page\n\nTwilio 2FA Verification can be enabled in the manager login as well. You can view the status of Twilio 2FA for each user in the menu under \n\"Extras -\u003e User Authentication\"\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmodxcms%2Ftwilio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmodxcms%2Ftwilio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmodxcms%2Ftwilio/lists"}