Mark Overmeer > Mozilla-Persona-0.12 > Mozilla::Persona::Validate::Table



Annotate this POD

View/Report Bugs
Module Version: 0.12   Source  


Mozilla::Persona::Validate::Table - validate the existence via a simple table


   is a Mozilla::Persona::Validate


  # add to the configation of $domain.json
  { ...
    "validate" : {
      "class"  : "Mozilla::Persona::Validator::Table",
      "pwfile" : "/etc/persona/passwords",
      "domain" : "",


The validator object must ensure that the user/password combination is valid. In this case, a simple password-file-like table is used to authenticate the user.

You may put that file with the other configuration information in /etc/persona/, for instance under the name passwords. This is the default when you run persona setup.

Password file syntax

Lines which are blank (visually empty) or start with a '#' (comment) are ignored. Other lines describe users.

The user definition lines contain (currently) three fields separated by a colon ':'. First a username, than the digest algorithm used (acceptable to Digest, you may need to install additional Digest modules) and finally the base64 encoded version of that digest. The username may either include the domain, or the domain must be set in the configuration.

Example of two lines in the passwords file:

  # my test user

With "domain" set to "", your usernames become easier


You may still use full usernames if you want. Full usernames which are in an other domain are silently dropped.

Be warned that md5sum produces hex, where we need base64 here. Other scripts output base64 directly, for instance sha256sum. You may use that to produce the third field of a user defining line:

  echo -n "my-password" | sha256sum
  echo "my-password\c"  | sha256sum



  domain  undef
  pwfile  <required>
domain => DOMAIN

Default domain for all users in the file.

pwfile => FILENAME

The password file. Probably, you want to provide an absolute path. When the file changes, it will automatically be reloaded.


$obj->isValid(USER, PASSWORD)

See "Validation" in Mozilla::Persona::Validate




This module is part of Mozilla-Persona distribution version 0.12, built on November 22, 2012. Website: The code is based on the MulkyID code by Matthias Benkard.

Persona is described at


Copyrights of the perl code and the related documentation by 2012 by [Mark Overmeer]. For other contributors see ChangeLog.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See

syntax highlighting: