<commit_before>Using mailtoken authentication with and SimpleSAMLphp
=====================================================

To use mailtoken as an authentication source you need to do the following.

  * Enable the module
  * Set up the database
  * Set up the authsources.php
  * Edit mail text

First thing to do is to enable the module

    touch PATHTOSIMPLESAML/module/mailtoken/enable

After that you need to set up the table, that mailtoken uses. First set up
a database e.g. MySQL, PostgreSQL ect.) You can only use dabases that have
drivers implemented in PDO.

Here is the initialization SQL script for MySQL

    CREATE TABLE `mailtoken__tokens` (
      `id` int(11) NOT NULL auto_increment,
      `mail` varchar(320) NOT NULL,
      `token` varchar(255) NOT NULL,
      `notvalidafter` varchar(255) NOT NULL,
      `usedat` varchar(255) default NULL,
      PRIMARY KEY  (`id`),
      UNIQUE KEY `token` (`token`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1

After you have set up your database you need to modify authsources.php in
config dir. Change the code below to fit your needs.

    'mailtoken' => array(
        'janus:MailToken',
        'dsn' => 'mysql:host=localhost;dbname=database_db',
        'username' => 'THEUSERNAME',
        'password' => '<PASSWORD>',
        'table' => 'mailtoken__tokens',
    ),

The last thing you need to do is to configuer the actual text that is mailed to
the users. Copy the config file template to SSP's config dir

    cp PATHTOSIMPELSAML/module/mailtoken/config-templates/module_mailtoken PATHTOSIMPLESAML/config/ 

I the config file you can edit the apparence of the email send. You can also
add email texts in different languages. REMEMBER to change the from and reply-to
addresses.<commit_msg>Changed docs to reflect that mailtoken is a seperate module<commit_after>Using mailtoken authentication with and SimpleSAMLphp
=====================================================

To use mailtoken as an authentication source you need to do the following.

  * Enable the module
  * Set up the database
  * Set up the authsources.php
  * Edit mail text

First thing to do is to enable the module

    touch PATHTOSIMPLESAML/module/mailtoken/enable

After that you need to set up the table, that mailtoken uses. First set up
a database e.g. MySQL, PostgreSQL ect.) You can only use dabases that have
drivers implemented in PDO.

Here is the initialization SQL script for MySQL

    CREATE TABLE `mailtoken__tokens` (
      `id` int(11) NOT NULL auto_increment,
      `mail` varchar(320) NOT NULL,
      `token` varchar(255) NOT NULL,
      `notvalidafter` varchar(255) NOT NULL,
      `usedat` varchar(255) default NULL,
      PRIMARY KEY  (`id`),
      UNIQUE KEY `token` (`token`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1

After you have set up your database you need to modify authsources.php in
config dir. Change the code below to fit your needs.

    'mailtoken' => array(
        'mailtoken:MailToken',
        'dsn' => 'mysql:host=localhost;dbname=database_db',
        'username' => 'THEUSERNAME',
        'password' => '<PASSWORD>',
        'table' => 'mailtoken__tokens',
    ),

The last thing you need to do is to configuer the actual text that is mailed to
the users. Copy the config file template to SSP's config dir

    cp PATHTOSIMPELSAML/module/mailtoken/config-templates/module_mailtoken PATHTOSIMPLESAML/config/ 

I the config file you can edit the apparence of the email send. You can also
add email texts in different languages. REMEMBER to change the from and reply-to
addresses.
{'fraction_non_alphanumeric': 0.09887640449438202, 'fraction_numerical': 0.008426966292134831, 'mean_word_length': 3.6488250652741514, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1310479', 'n_tokens_mistral': 1085, 'n_tokens_neox': 996, 'n_words': 434}