Mark Overmeer > Mozilla-Persona-0.12 > Mozilla::Persona::Server

Download:
Mozilla-Persona-0.12.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.12   Source  

NAME ^

Mozilla::Persona::Server - persona user validation

SYNOPSIS ^

  # run set-up script first
  persona setup <options>

  my $persona = Mozilla::Persona->new(...);
  my $persona = Mozilla::Persona->fromConfig($fn);
  $persona->writeConfig($fn);

DESCRIPTION ^

This module organizes the server-side Persona adminstration, with a few helpers which can have alternative implementations.

METHODS ^

Constructors

Mozilla::Persona::Server->fromConfig(FILENAME, OPTIONS)

Read the configuration from FILENAME (which contains JASON). The OPTIONS overrule the read data. The data is used to instantiate this object via the usual procedure, so see new().

Mozilla::Persona::Server->new(OPTIONS)
 -Option     --Default
  aliases      See manpage Mozilla::Persona::Aliases
  cookie_name  <required>
  domain       <required>
  private_pem  <required>
  validator    See manpage Mozilla::Persona::Validate
aliases => HASH

One used may have more than one valid email address for various purposes. Any of these aliases suffices to login. The HASH of information is passed as configuration for the ::Aliases object.

cookie_name => STRING

The name of the cookie, used to administer the persona session.

domain => DOMAIN

Your domain, which may be a super-level from the website's domain, or even an other domain you own.

private_pem => FILENAME

FILENAME which contains the private key, generated by the set-up script.

validator => HASH

Used to check whether the user is validated for this domain. The HASH of information is passed as configuration for the ::Aliases object.

Accessors

$obj->aliases()

Returns the aliases object, an Mozilla::Persona::Aliases extension.

The object gets instantiated on first call to this method the first call to this method, so lazy.

$obj->cookie()
$obj->domain()
$obj->privatePEM()

Returns the Crypt::OpenSSL::RSA object which contains the private PEM (private key).

$obj->validator()

Returns the validator object, an Mozilla::Persona::Validate extension.

The object gets instantiated on first call to this method the first call to this method, so lazy.

Actions

Actions are activities requested by the client.

$obj->actionIsLoggedIn(CGI)

Check whether the user is logged-in.

$obj->actionLogin(CGI)

Handle a login request.

$obj->actionPing(CGI)

Used then checking the installation: can the script be run?

$obj->actionSign(CGI)

Handle a sign request.

$obj->getSession(CGI)

Return the CGI::Session for this persona user, based of information received via CGI.

Helpers

$obj->isAliasFor(USER, EMAIL)

Check whether the USER is one of the aliases for the specified EMAIL address.

$obj->writeConfig(FILENAME)

Write the configuration of this object to the FILENAME.

SEE ALSO ^

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

Persona is described at http://www.mozilla.org/persona/

COPYRIGHTS ^

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 http://www.perl.com/perl/misc/Artistic.html

syntax highlighting: