GAuthx enables the use of the Google Authenticator mobile app for 2-factor-authentication in conjunction with Shaun McCormick's Login Snippet (https://github.com/splittingred/Login). This Extra contains two snippets, one to generate secrets and present a QR-Code for scanning the secret. The other is used as a Login PreHook to validate codes when a user attempts to login.
The system also includes a class for preventing replay-attack's by making sure that previously used codes cannot be reused.
You can install GAuthx via the standard MODx package manager.
GAuthx creates a new Auth Secret for the currently logged in user, and provides them with a QR Code that can be scanned by any 2 Factor Authentication app.
Once the QR Code or Auth Secret has been inputed into the app, the user must then validate the token is set up correctly and working by using the supplied validation form. If the token supplied by the user validates, the auth secret will then be accociated with that users account and they will be required to use their authentication token upon each login going forward.
Name | Type | Default | Description |
---|---|---|---|
responseTpl | Optional / String | GAuthxResponse | Chunk name used to format the response message |
tpl | Optional / String | GAuthxTpl | Chunk name used to format QR Code and Verification Form |
[[!GAuthx? &responseTpl=`GAuthxResponseTpl` &tpl=`GAuthxTpl`]]
This Snippet is to be useds as a PRE-Hook for Shaun McCormick's snippet "Login" - it allows for you to add 2 factor authentication (using google authenticator) to your member only areas in any front-end context on your site.
Name | Type | Default | Description |
---|---|---|---|
tolerance | Optional / Integer | 2 | Sets the amount of time / tolerance you wish the authenticator to allow a provided token to be valid for. |
historyLimit | Optional / Integer | 10 | Sets the number of provided tokens you wish to be remembered before a token could be used again. |
loginTpl | Optional / String | GAuthxLoginTpl | Example Tpl for the Login snippet that includes the correct token input feild. |
GAuthxHook is intended to be used as a PreHook for the Login snippet by @Splittingred.
I have also included an example loginTpl that includes the token input.
[[!Login?
&loginTpl=`GAuthxLoginTpl`
&preHooks=`GAuthxHook`
&tolerance=`3`
&historyLimit=`5`
]]
Please log any bugs / features quests on Github
GAuthx uses the Google Authenticator class by PHPGangsta for generating QR Codes and validating user tokens.