Skip to content

Commit

Permalink
Item14459: Documentation and configure fixes
Browse files Browse the repository at this point in the history
Move the Login Manager configuration up into the Login tab. Hide the
template overrides and debug options.

Fix the regexes for the options extract, so that it doesn't embed
spaces into the list.
  • Loading branch information
gac410 committed Aug 23, 2017
1 parent fe027a4 commit 48503b0
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 40 deletions.
42 changes: 23 additions & 19 deletions data/System/SmsTwoStepAuthContrib.txt
@@ -1,4 +1,4 @@
%META:TOPICINFO{author="ProjectContributor" comment="" date="1503197778" format="1.1" version="1"}%
%META:TOPICINFO{author="ProjectContributor" comment="" date="1503452085" format="1.1" version="1"}%
---+!! SMS Two-Step Authentication Contrib Package
<sticky>
<div style="float:right; background-color:#EBEEF0; margin:0 0 20px 20px; padding: 0 10px 0 10px;">
Expand All @@ -8,7 +8,7 @@
<img src="%ATTACHURLPATH%/sms-access-code-login-350.png" alt="sms-access-code-login-350.png" width="329" height="350" />
</div>
</sticky>
%SHORTDESCRIPTION%
%FORMFIELD{"Description"}%

---++ Introduction

Expand All @@ -27,7 +27,7 @@ This requires the user to have two factors for access. Something they "know" -

<sticky><div style="float:right; margin:0 0 20px 20px; padding: 0 10px 0 10px;">
&nbsp;&nbsp; __Diagram of two-step log-in process:__ %BR%
<img src="%ATTACHURLPATH%/sms-2step-auth-diagram-v2.png" alt="sms-2step-auth-diagram-v2.png" width="600" height="600" />
<img src="%ATTACHURLPATH%/sms-2step-auth-diagram.png" alt="sms-2step-auth-diagram.png" width="600" height="600" />
</div></sticky>
Once this extension is installed and configured properly, the log-in process happens as follows:

Expand Down Expand Up @@ -104,11 +104,13 @@ __Carrier missing?__ Find more in these e-mail to SMS gateway lists:

* http://www.ukrainecalling.com/email-to-text.aspx
* http://www.emailtextmessages.com/
* http://www.wigwag.com/devblog/send-free-sms-texts-through-gateways/
* https://www.opentextingonline.com/emailtotext.aspx
* https://github.com/cubiclesoft/email_sms_mms_gateways


---+++ Section carrierlist

The "carrierlist" section returns a comma separated list of carriers listed in this topic; it also sets spreadsheet hashes for later use.
The "carrierlist" section returns a comma separated list of carriers listed in this topic.

<div style="display: none;">
%STARTSECTION{carrierlist}%%SEARCH{
Expand All @@ -118,11 +120,16 @@ The "carrierlist" section returns a comma separated list of carriers listed in t
topic="%TOPIC%"
nonoise="on"
multiple="on"
format="$pattern(.*\| *E2SMS *\|\s*([^\|]+).*)"
format="$pattern(.*\| *E2SMS *\| *(.*?) *\|.*)"
separator=","
}%%ENDSECTION{carrierlist}%
</div>

---+++ Section carrierselect

The "carrierselect" section returns the carrier list as HTML options statements for use in the
user registration drop-down, or other forms.

<div style="display: none;">
%STARTSECTION{carrierselect}%
%FORMAT{"%SEARCH{
Expand All @@ -132,7 +139,7 @@ The "carrierlist" section returns a comma separated list of carriers listed in t
topic="%TOPIC%"
nonoise="on"
multiple="on"
format="$pattern(.*\| *E2SMS *\|\s*([^\|]+).*)"
format="$pattern(.*\| *E2SMS *\| *(.*?) *\|.*)"
separator=","
}%"
type="string"
Expand Down Expand Up @@ -219,8 +226,6 @@ Test if the configuration is successful:
* From a location that is white-listed, e.g. has its IP address in ={SmsTwoStepAuthContrib}{WhitelistAddresses}= do this:
* Log in with log-in name and password. You should be able to log in with a single step.
* Edit your user profile topic and specify a mobile number and mobile carrier.
* A "Send SMS" button should appear below the mobile number.
* Click on the "Send SMS" button and send yourself an SMS to verify proper operation.

* From a location that is *not* white-listed do this:
* Log in with log-in name and password.
Expand All @@ -232,35 +237,34 @@ Test if the configuration is successful:

---++ Contrib Info

* Set SHORTDESCRIPTION = Two-step authentication using SMS for the second step

__Related Topics:__ %SYSTEMWEB%.FoswikiContribs, %SYSTEMWEB%.FoswikiPreferences

---++ Change History

%TABLE{columnwidths="7em" tablewidth="100%"}%
| 23 Aug 2017 | (1.01) - Foswikitask:Item14459: Intial release for Foswiki |
| 2016-01-17: | TWikibug:Item7708: Copyright update to 2016 |
| 2014-09-22: | TWikibug:Item7539: Add {TwoStepAuth} configuration, with 'disabled', 'optional' and 'required' two-step authentication modes |
| 2014-09-11: | TWikibug:Item7540: Add debug flag and debug code |
| 2014-09-10: | TWikibug:Item7540: Initial version |

Many thanks to the following sponsors for supporting this work:
* [[http://www.wave.com/][Wave Systems Corp.]]
* [[https://www.wave.com/][Wave Systems Corp.]]

<!-- Do _not_ attempt to edit this topic; it is auto-generated. Please add comments/questions/remarks to the Dev topic instead. -->


%META:FORM{name="PackageForm"}%
%META:FIELD{name="Author" title="Author" value="TWiki:Main.PeteerThoeny, Foswiki:Main.GeorgeClark"}%
%META:FIELD{name="Author" title="Author" value="TWiki:Main.PeterThoeny, Foswiki:Main.GeorgeClark"}%
%META:FIELD{name="Version" title="Version" value="%25$VERSION%25"}%
%META:FIELD{name="Release" title="Release" value="%25$RELEASE%25"}%
%META:FIELD{name="Description" title="Description" value=""}%
%META:FIELD{name="Description" title="Description" value="%25$SHORTDESCRIPTION%25"}%
%META:FIELD{name="Repository" title="Repository" value="https://github.com/foswiki/SmsTwoFactorAuthContrib"}%
%META:FIELD{name="Copyright" title="Copyright" value="&copy; 2014 Wave Systems Corp. %25BR%25 &copy; 2014-2016 TWiki:Main.PeterThoeny %25BR%25 &copy; 2014-2016 TWiki:TWiki.TWikiContributor %25BR%25 &copy; 2017 ProjectContributors"}%
%META:FIELD{name="License" title="License" value="[[http://www.gnu.org/licenses/gpl.html][GPL (Gnu General Public License)]]"}%
%META:FIELD{name="License" title="License" value="[[https://www.gnu.org/licenses/gpl.html][GPL (Gnu General Public License)]]"}%
%META:FIELD{name="Home" title="Home" value="Foswiki:Extensions.%25$ROOTMODULE%25"}%
%META:FIELD{name="Support" title="Support" value="Foswiki:Support.%25$ROOTMODULE%25"}%
%META:FILEATTACHMENT{name="mobile-carrier.gif" attachment="mobile-carrier.gif" attr="h" comment="" date="1503197778" size="890" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="sms.gif" attachment="sms.gif" attr="h" comment="" date="1503197778" size="2243" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="sms-2step-auth-diagram.png" attachment="sms-2step-auth-diagram.png" attr="h" comment="" date="1503197778" size="79934" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="sms-access-code-login-350.png" attachment="sms-access-code-login-350.png" attr="h" comment="" date="1503197778" size="53563" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="mobile-carrier.gif" attachment="mobile-carrier.gif" attr="h" comment="" date="1503452085" size="890" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="sms.gif" attachment="sms.gif" attr="h" comment="" date="1503452085" size="2243" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="sms-2step-auth-diagram.png" attachment="sms-2step-auth-diagram.png" attr="h" comment="" date="1503452085" size="79934" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="sms-access-code-login-350.png" attachment="sms-access-code-login-350.png" attr="h" comment="" date="1503452085" size="53563" user="ProjectContributor" version="1"}%
5 changes: 2 additions & 3 deletions lib/Foswiki/Contrib/SmsTwoStepAuthContrib.pm
@@ -1,7 +1,6 @@
# See bottom of file for default license and copyright information

=begin TML
---+ package Foswiki::Contrib::SmsTwoStepAuthContrib
This is a stub module for a new contrib . Customise this module as required .
Expand All @@ -14,8 +13,8 @@ package Foswiki::Contrib::SmsTwoStepAuthContrib;
use strict;
use warnings;

our $VERSION = '1.0';
our $RELEASE = '1 Sept 2017';
our $VERSION = '1.01';
our $RELEASE = '23 Aug 2017';

our $SHORTDESCRIPTION =
'Provide 2-factor login authentication using SMS messages.';
Expand Down
35 changes: 17 additions & 18 deletions lib/Foswiki/Contrib/SmsTwoStepAuthContrib/Config.spec
@@ -1,27 +1,26 @@
# ---+ Extensions
# ---++ SMS Two-Step Auth Contrib
# This is the configuration of the <b>SmsTwoStepAuthContrib</b>.
#---+ Security and Authentication
#---++ Login

# **STRING 80**
# White-listed IP addresses. Specify a comma-space separated list. Partial IP addresses
# **STRING 80 LABEL="White List Addresses" DISPLAY_IF="{LoginManager}=='Foswiki::LoginManager::SmsTwoStepLogin'" **
# White-listed IP addresses that can bypass 2-step authentication. Specify a comma-space separated list. Partial IP addresses
# ending in a dot can be used to specify a range. Example: <tt>1.2.3.4, 5.6.7.</tt>
$Foswiki::cfg{SmsTwoStepAuthContrib}{WhitelistAddresses} = '';

# **NUMBER**
# **NUMBER LABEL="Access Code Lifetime" DISPLAY_IF="{LoginManager}=='Foswiki::LoginManager::SmsTwoStepLogin'"**
# Maximum age of access code in seconds, default is 600 (10 min).
$Foswiki::cfg{SmsTwoStepAuthContrib}{MaxAge} = 600;

# **SELECT off, optional, required**
# **SELECT off,optional,required LABEL="Two Step Authentication" DISPLAY_IF="{LoginManager}=='Foswiki::LoginManager::SmsTwoStepLogin'"**
# Mode of two-step authentication:
# <ul> <li> <tt>disabled</tt>: Single step authentication.
# </li> <li> <tt>optional</tt>: Optional, e.g. user can chose. <b><i>Attention:</i></b>
# The UserForm and UserProfileHeader need to be updated - see installation instructions.
# The UserForm and User Registration forms may need to be updated - see installation instructions.
# </li> <li> <tt>required</tt>: Required for all users. (default)
# </li> </ul>
$Foswiki::cfg{SmsTwoStepAuthContrib}{TwoStepAuth} = 'required';

# **STRING 80**
# It is possible to send the access code by e-mail instead of SMS if the user has not
# **STRING 80 LABEL="Allow Email Fallback" DISPLAY_IF="{LoginManager}=='Foswiki::LoginManager::SmsTwoStepLogin'"**
# Allow the access code to be sent by Email instead of SMS if the user has not
# specified a mobile number and a carrier. Possible values:
# <ul> <li> <tt>0</tt> or empty value: No e-mail sent, user cannot login (more secure).
# </li> <li> <tt>1</tt>: Users with missing mobile and carrier get an e-mail with access
Expand All @@ -33,32 +32,32 @@ $Foswiki::cfg{SmsTwoStepAuthContrib}{TwoStepAuth} = 'required';
# </li> </ul>
$Foswiki::cfg{SmsTwoStepAuthContrib}{AllowEmail} = '';

# **STRING 80**
# **STRING 80 EXPERT**
# Name of two-step message template for SMS message, default 'smstwostepmessage'.
$Foswiki::cfg{SmsTwoStepAuthContrib}{SmsMessageTmpl} = 'smstwostepmessage';

# **STRING 80**
# **STRING 80 EXPERT**
# Name of log-in screen template for SMS log-in, default 'smstwosteplogin'.
$Foswiki::cfg{SmsTwoStepAuthContrib}{SmsLoginTmpl} = 'smstwosteplogin';

# **STRING 80**
# **STRING 80 EXPERT**
# Name of two-step message template for e-mail message, default 'smstwostepemailmessage'.
$Foswiki::cfg{SmsTwoStepAuthContrib}{EmailMessageTmpl} = 'smstwostepemailmessage';

# **STRING 80**
# **STRING 80 EXPERT**
# Name of log-in screen template for e-mail log-in, default 'smstwostepemaillogin'.
$Foswiki::cfg{SmsTwoStepAuthContrib}{EmailLoginTmpl} = 'smstwostepemaillogin';

# **STRING 80**
# **STRING 80 EXPERT**
# Name of log-in screen template in case of insufficient credentials, default 'smstwosteperrorlogin'.
$Foswiki::cfg{SmsTwoStepAuthContrib}{ErrorLoginTmpl} = 'smstwosteperrorlogin';

# **STRING 80**
# **STRING 80 EXPERT**
# Access code error message.
$Foswiki::cfg{SmsTwoStepAuthContrib}{AcessCodeError} = 'Invalid or outdated access code, please try again.';

# **BOOLEAN**
# Debug flag - see output in <code>twiki/data/debug.txt</code>.
# **BOOLEAN EXPERT**
# Debug flag - see output in <code>foswiki/working/logs/debug.log</code>.
$Foswiki::cfg{SmsTwoStepAuthContrib}{Debug} = 0;

1;

0 comments on commit 48503b0

Please sign in to comment.