Two-factor authentication and more access control

Problem

You want to confirm that the respondent is the intended target for the questionnaire.

Solution

Use the "2FA" pound instruction.

Discussion

When the 2FA pound instruction exists and has been validated by compilation, CallWeb allows response into the questionnaire only once a two-factor authentication cookie has been set. This is done by entering a randomly generated code in the CallWeb script; the code is generated by CallWeb and sent to the respondent's email address. Let's see the details starting with the syntax of # 2FA.

    # 2FA =
      #> [EMAILQUESTION]name of an EMAIL question
      #> [EMAILADDRESS]name of the open-end part of the question containing the email address of the respondent
      #> [CODEPATTERN]code pattern
      #> [STORECODE]name of an open-ended STOCK question to store the random code
      #> [COLLECTCODE]name of the question used to collect the random code from the respondent
      #> [FROM]email address used to send the 2FA message
  • EMAILQUESTION: this is the name of an EMAIL question that will be used to transmit the random code to the respondent. It is EMAIL2FA in the example below.
  • EMAILADDRESS: this is the name of an open-ended part containing the email address of the respondent. This is the address where the message containing the random code will be sent.
  • CODEPATTERN: the random code used to authenticate the respondent can follow any pattern as defined by the syntax used by # Telkey pattern: sequence of letters corresponding to the number and type of characters used: [C]onsonant, [V]owel, [L]etter, [N]umeric, [S]pecial and [?] for any of these. It is common to use six-digit numbers for 2FA purposes; that would be a pattern of NNNNNN.
  • STORECODE: this is the name of the question that will store the random code in its open-ended part.
  • COLLECTCODE: this is the name of the question that will be used to ask the respondent to enter the random code.
  • FROM: this is the email address used to send the 2FA message. This is not a question; it is an actual address or a substitution

Here is a working example.

    # 2FA =
      #> [emailquestion]EMAIL2FA
      #> [emailaddress]EMAIL
      #> [codepattern]NNNNNN
      #> [storecode]STORE2FA
      #> [collectcode]COLLECT2FA
      #> [from]2fa@callweb.ca
    EMAIL2FA EMAIL
    % texte de la question
      Your confirmation code for {$contexte{projet}} / Votre code de confirmation pour {$contexte{projet}}
    % texte de la note
      <p>(Le français suit l'anglais.)</p>
      <p>------------------------------------------------------------</p>
      <p>This message was sent to the email address found in your questionnaire for project "{$contexte{projet}}".</p>
      <p>Please enter this six-digit code in the web form to confirm that you control this email address.</p>
      <p>&&ASTORE2FA</p>
      <p>------------------------------------------------------------</p>
      <p>Ce message a été envoyé à l'adresse de courriel identifiée dans votre questionnaire pour le projet « {$contexte{projet}} ».</p>
      <p>Veuillez saisir le code à six chiffres suivant dans le formulaire Web pour confirmer que vous contrôlez cette adresse courriel.</p>
      <p>&&ASTORE2FA</p>
       
        <html>

        <head></head>

        <body style='margin: 0px 0px 0px 0px; font-family: Arial, Helvetica, sans-serif; font-size: 18px; color: #000000;'>

        <table border="0" cellpadding="5" cellspacing="5" width="100%">

        <tr>
        <td width="48%" height="0"></td>
        <td width="4%" height="0"></td>
        <td width="48%" height="0"></td>
        </tr>

        <tr valign="top">
        <td>This message was sent to the email address found in your questionnaire for project "{$contexte{projet}}".</td>
        <td> </td>
        <td>Ce message a été envoyé à l'adresse de courriel identifiée dans votre questionnaire pour le projet « {$contexte{projet}}nbsp;».</td>
        </tr>

        <tr valign="top">
        <td>Please enter this six-digit code in the web form to confirm that you control this email address.</td>
        <td> </td>
        <td>Veuillez saisir le code à six chiffres suivant dans le formulaire Web pour confirmer que vous contrôlez cette adresse courriel.</td>
        </tr>

        <tr>
        <td colspan="3" align="center"><div style="font-size: 24px; background-color: red ;color: white;">&&ASTORE2FA</div></td>
        </tr>

        </table>

        </body>

        </html>
    % catégories de réponses
    % sauts inconditionnels
    % condition
    % partie ouverte
    ! ==================================================
    EMAIL STOCK
    % texte de la question
    % texte de la note
    % catégories de réponses
     
    % sauts inconditionnels
    % condition
    % partie ouverte
      1 = E50 1 50
    ! ==================================================
    STORE2FA STOCK
    % texte de la question
    % texte de la note
    % catégories de réponses
     
    % sauts inconditionnels
    % condition
    % partie ouverte
      1 = C10 1 10
    ! ==================================================
    COLLECT2FA
    % texte de la question
      [EN]A six-digit code has been emailed to &&AEMAIL to confirm that you are the owner of this address. Please enter this six-digit code below.
      [FR]Un code à six chiffres a été envoyé par courriel à l'adresse &&AEMAIL pour confirmer que vous êtes bien propriétaire de cette adresse. Veuillez saisir ce code à six chiffres ci-bas.
    % texte de la note
    % catégories de réponses
     
    % sauts inconditionnels
    % condition
    % partie ouverte
      1 = C10 1 10
    ! ==================================================

Two-factor authentication and more access control

Problem

You want to confirm that the respondent is the intended target for the questionnaire.

Solution

Use the "2FA" pound instruction.

Discussion

When the 2FA pound instruction exists and has been validated by compilation, CallWeb allows response into the questionnaire only once a two-factor authentication cookie has been set. This is done by entering a randomly generated code in the CallWeb script; the code is generated by CallWeb and sent to the respondent's email address. Let's see the details starting with the syntax of # 2FA.

    # 2FA =
      #> [EMAILQUESTION]name of an EMAIL question
      #> [EMAILADDRESS]name of the open-end part of the question containing the email address of the respondent
      #> [CODEPATTERN]code pattern
      #> [STORECODE]name of an open-ended STOCK question to store the random code
      #> [COLLECTCODE]name of the question used to collect the random code from the respondent
      #> [FROM]email address used to send the 2FA message
  • EMAILQUESTION: this is the name of an EMAIL question that will be used to transmit the random code to the respondent. It is EMAIL2FA in the example below.
  • EMAILADDRESS: this is the name of an open-ended part containing the email address of the respondent. This is the address where the message containing the random code will be sent.
  • CODEPATTERN: the random code used to authenticate the respondent can follow any pattern as defined by the syntax used by # Telkey pattern: sequence of letters corresponding to the number and type of characters used: [C]onsonant, [V]owel, [L]etter, [N]umeric, [S]pecial and [?] for any of these. It is common to use six-digit numbers for 2FA purposes; that would be a pattern of NNNNNN.
  • STORECODE: this is the name of the question that will store the random code in its open-ended part.
  • COLLECTCODE: this is the name of the question that will be used to ask the respondent to enter the random code.
  • FROM: this is the email address used to send the 2FA message. This is not a question; it is an actual address or a substitution

Here is a working example.

    # 2FA =
      #> [emailquestion]EMAIL2FA
      #> [emailaddress]EMAIL
      #> [codepattern]NNNNNN
      #> [storecode]STORE2FA
      #> [collectcode]COLLECT2FA
      #> [from]2fa@callweb.ca
    EMAIL2FA EMAIL
    % texte de la question
      Your confirmation code for {$contexte{projet}} / Votre code de confirmation pour {$contexte{projet}}
    % texte de la note
      <p>(Le français suit l'anglais.)</p>
      <p>------------------------------------------------------------</p>
      <p>This message was sent to the email address found in your questionnaire for project "{$contexte{projet}}".</p>
      <p>Please enter this six-digit code in the web form to confirm that you control this email address.</p>
      <p>&&ASTORE2FA</p>
      <p>------------------------------------------------------------</p>
      <p>Ce message a été envoyé à l'adresse de courriel identifiée dans votre questionnaire pour le projet « {$contexte{projet}} ».</p>
      <p>Veuillez saisir le code à six chiffres suivant dans le formulaire Web pour confirmer que vous contrôlez cette adresse courriel.</p>
      <p>&&ASTORE2FA</p>
       
        <html>

        <head></head>

        <body style='margin: 0px 0px 0px 0px; font-family: Arial, Helvetica, sans-serif; font-size: 18px; color: #000000;'>

        <table border="0" cellpadding="5" cellspacing="5" width="100%">

        <tr>
        <td width="48%" height="0"></td>
        <td width="4%" height="0"></td>
        <td width="48%" height="0"></td>
        </tr>

        <tr valign="top">
        <td>This message was sent to the email address found in your questionnaire for project "{$contexte{projet}}".</td>
        <td> </td>
        <td>Ce message a été envoyé à l'adresse de courriel identifiée dans votre questionnaire pour le projet « {$contexte{projet}}nbsp;».</td>
        </tr>

        <tr valign="top">
        <td>Please enter this six-digit code in the web form to confirm that you control this email address.</td>
        <td> </td>
        <td>Veuillez saisir le code à six chiffres suivant dans le formulaire Web pour confirmer que vous contrôlez cette adresse courriel.</td>
        </tr>

        <tr>
        <td colspan="3" align="center"><div style="font-size: 24px; background-color: red ;color: white;">&&ASTORE2FA</div></td>
        </tr>

        </table>

        </body>

        </html>
    % catégories de réponses
    % sauts inconditionnels
    % condition
    % partie ouverte
    ! ==================================================
    EMAIL STOCK
    % texte de la question
    % texte de la note
    % catégories de réponses
     
    % sauts inconditionnels
    % condition
    % partie ouverte
      1 = E50 1 50
    ! ==================================================
    STORE2FA STOCK
    % texte de la question
    % texte de la note
    % catégories de réponses
     
    % sauts inconditionnels
    % condition
    % partie ouverte
      1 = C10 1 10
    ! ==================================================
    COLLECT2FA
    % texte de la question
      [EN]A six-digit code has been emailed to &&AEMAIL to confirm that you are the owner of this address. Please enter this six-digit code below.
      [FR]Un code à six chiffres a été envoyé par courriel à l'adresse &&AEMAIL pour confirmer que vous êtes bien propriétaire de cette adresse. Veuillez saisir ce code à six chiffres ci-bas.
    % texte de la note
    % catégories de réponses
     
    % sauts inconditionnels
    % condition
    % partie ouverte
      1 = C10 1 10
    ! ==================================================